forked from Github/cordova-plugin-run-in-background
Android notification update now updates inline
This commit is contained in:
@@ -59,12 +59,15 @@ public class BackgroundMode extends CordovaPlugin {
|
||||
// Tmp config settings for the notification
|
||||
private static JSONObject updateSettings;
|
||||
|
||||
ForegroundService mService;
|
||||
|
||||
// Used to (un)bind the service to with the activity
|
||||
private final ServiceConnection connection = new ServiceConnection() {
|
||||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder binder) {
|
||||
// Nothing to do here
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
ForegroundService.ForegroundBinder binder = (ForegroundService.ForegroundBinder) service;
|
||||
mService = binder.getService();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -216,8 +219,7 @@ public class BackgroundMode extends CordovaPlugin {
|
||||
*/
|
||||
private void updateNotifcation() {
|
||||
if (isBind) {
|
||||
stopService();
|
||||
startService();
|
||||
mService.updateNotification();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user