Skip to content

Commit e2fc302

Browse files
committed
Default for SHOW_IN_FEGROUND is true
1 parent c5562f7 commit e2fc302

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

com.unity.mobile.notifications/Runtime/Android/AndroidNotificationCenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ internal static AndroidNotificationIntentData GetNotificationData(AndroidJavaObj
497497
notification.UsesStopwatch = extras.Call<bool>("getBoolean", Notification_EXTRA_SHOW_CHRONOMETER, false);
498498
notification.FireTime = extras.Call<long>("getLong", KEY_FIRE_TIME, -1L).ToDatetime();
499499
notification.RepeatInterval = extras.Call<long>("getLong", KEY_REPEAT_INTERVAL, -1L).ToTimeSpan();
500-
notification.ShowInForeground = extras.Call<bool>("getBoolean", SHOW_IN_FOREGROUND, false);
500+
notification.ShowInForeground = extras.Call<bool>("getBoolean", SHOW_IN_FOREGROUND, true);
501501

502502
if (extras.Call<bool>("containsKey", Notification_EXTRA_BIG_TEXT))
503503
notification.Style = NotificationStyle.BigTextStyle;

com.unity.mobile.notifications/Runtime/Android/Plugins/com/unity/androidnotifications/UnityNotificationManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ public void onReceive(Context context, Intent intent) {
681681

682682
// Call the system notification service to notify the notification.
683683
protected static void notify(Context context, int id, Notification notification) {
684-
boolean showInForeground = notification.extras.getBoolean(SHOW_IN_FOREGROUND, false);
684+
boolean showInForeground = notification.extras.getBoolean(SHOW_IN_FOREGROUND, true);
685685
if (!isInForeground() || showInForeground) {
686686
getNotificationManager(context).notify(id, notification);
687687
}
@@ -809,7 +809,7 @@ public static String getNotificationChannelId(Notification notification) {
809809

810810
return null;
811811
}
812-
812+
813813
private static boolean isInForeground() {
814814
ActivityManager.RunningAppProcessInfo appProcessInfo = new ActivityManager.RunningAppProcessInfo();
815815
ActivityManager.getMyMemoryState(appProcessInfo);

0 commit comments

Comments
 (0)