Loading src/android/LocalNotificationReceiver.java +5 −0 Changes for src/android/LocalNotificationReceiver.java: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -87,10 +87,15 @@ public class LocalNotificationReceiver extends BroadcastReceiver { .setTicker(options.getTitle()) .setSmallIcon(options.getIcon()); try { if (!context.getPackageName().equalsIgnoreCase(((ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE)).getRunningTasks(1).get(0).topActivity.getPackageName())) { // app is in background notification.setDefaults(Notification.DEFAULT_SOUND); } } catch (Exception e) { // missing GET_TASKS permission notification.setDefaults(Notification.DEFAULT_SOUND); } /* * If you want all reminders to stay in the notification bar, you should Loading Loading
src/android/LocalNotificationReceiver.java +5 −0 Changes for src/android/LocalNotificationReceiver.java: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -87,10 +87,15 @@ public class LocalNotificationReceiver extends BroadcastReceiver { .setTicker(options.getTitle()) .setSmallIcon(options.getIcon()); try { if (!context.getPackageName().equalsIgnoreCase(((ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE)).getRunningTasks(1).get(0).topActivity.getPackageName())) { // app is in background notification.setDefaults(Notification.DEFAULT_SOUND); } } catch (Exception e) { // missing GET_TASKS permission notification.setDefaults(Notification.DEFAULT_SOUND); } /* * If you want all reminders to stay in the notification bar, you should Loading