Skip to content

Commit

Permalink
Fixed background plugin to be silent
Browse files Browse the repository at this point in the history
  • Loading branch information
OhMyGuus committed Feb 9, 2021
1 parent 4edf63b commit 23949af
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "io.bettercrewlink.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 20
versionName "1.0.13"
versionCode 21
versionName "1.0.20"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void CreateNotification() {
String body = "<b>Guus(red)</b> talking <br><b>player2(lime)</b> talking";
SpannableString spannableString = new SpannableString(Build.VERSION.SDK_INT < Build.VERSION_CODES.N ? Html.fromHtml(body) : Html.fromHtml(body, Html.FROM_HTML_MODE_LEGACY));

NotificationCompat.Builder builder = new NotificationCompat.Builder(this.getContext(), "cordova-plugin-background-mode-id")
NotificationCompat.Builder builder = new NotificationCompat.Builder(this.getContext(), "bettercrewlink-background-id")
.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(refreshAction)
.setContentTitle("BetterCrewlink")
Expand Down
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"cordova-plugin-appcenter-analytics": "^0.5.1",
"cordova-plugin-appcenter-crashes": "^0.5.1",
"cordova-plugin-appcenter-shared": "^0.5.1",
"cordova-plugin-background-mode": "^0.7.3",
"cordova-plugin-background-mode": "git+https://github.com/OhMyGuus/cordova-plugin-background-mode.git",
"cordova-plugin-device": "^2.0.3",
"jetifier": "^1.6.6",
"ng2-fittext": "^1.2.12",
Expand Down
25 changes: 13 additions & 12 deletions src/app/services/game-helper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ export class GameHelperService extends EventEmitterO implements IGameHelperServi
connect() {
this.disconnect(false);

this.appCenterAnalytics.trackEvent('connect', {
gameCode: this.settings.gamecode.toUpperCase(),
username: this.settings.username,
micrphone: this.settings.selectedMicrophone.deviceId,
natfixEnabled: this.settings.natFix ? 'true' : 'false',
time: new Date().toISOString(),
});
this.appCenterAnalytics
.trackEvent('connect', {
gameCode: this.settings.gamecode.toUpperCase(),
username: this.settings.username,
micrphone: this.settings.selectedMicrophone.deviceId,
natfixEnabled: this.settings.natFix ? 'true' : 'false',
})
.then(() => {});

this.requestPermissions().then((haspermissions) => {
if (!haspermissions) {
Expand All @@ -99,13 +100,13 @@ export class GameHelperService extends EventEmitterO implements IGameHelperServi
if (disableBackgroundMode) {
this.backgroundMode.disable();
BetterCrewlinkNativePlugin.disconnect();
this.appCenterAnalytics
.trackEvent('disconnect', {
disableBackgroundMode: disableBackgroundMode ? 'true' : 'false',
})
.then(() => {});
}
this.cManager.disconnect(true);

this.appCenterAnalytics.trackEvent('disconnect', {
disableBackgroundMode: disableBackgroundMode ? 'true' : 'false',
time: new Date().toISOString(),
});
}

muteMicrophone() {
Expand Down

0 comments on commit 23949af

Please sign in to comment.