Alessandro71 Well-Known Member Licensed User Longtime User Aug 11, 2023 #1 I'm trying to replicate the behavior of the Android Notification object on iOS. In Android, the notification is displayed as soon as Notify is called, while on iOS the Notification is scheduled and shown only if the app is not on foreground. If the app is on screen, no notification is shown. I'm using this code B4X: Copy Dim n As Notification n.Initialize(DateTime.Now + 1000) n.IconBadgeNumber = 1 n.AlertBody = text n.PlaySound = True n.Register Is it possible to show the notification in both cases (app opened or closed)?
I'm trying to replicate the behavior of the Android Notification object on iOS. In Android, the notification is displayed as soon as Notify is called, while on iOS the Notification is scheduled and shown only if the app is not on foreground. If the app is on screen, no notification is shown. I'm using this code B4X: Copy Dim n As Notification n.Initialize(DateTime.Now + 1000) n.IconBadgeNumber = 1 n.AlertBody = text n.PlaySound = True n.Register Is it possible to show the notification in both cases (app opened or closed)?
Alessandro71 Well-Known Member Licensed User Longtime User Aug 12, 2023 #2 Looks like it was just a case of building the right search engine query: searching for "ios notification" gives no useful answers, while using "UNMutableNotificationContent" (after a look at stackoverflow.com) pointed me to the right thread: https://www.b4x.com/android/forum/threads/local-notification-in-foreground.108796/ Upvote 2
Looks like it was just a case of building the right search engine query: searching for "ios notification" gives no useful answers, while using "UNMutableNotificationContent" (after a look at stackoverflow.com) pointed me to the right thread: https://www.b4x.com/android/forum/threads/local-notification-in-foreground.108796/