Wherever they are delivered immediately or not, the way I remove them is (note that this solution removes all of them, not individually, which can lead to info loss if there is more than one pending...). More info
HERE
[CODE lang="b4x" title="Remove local notifications"]Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler)
'Log($"Message arrived: ${Message}"$)
' This will remove them all. Still struggling to remove individually
Dim no As NativeObject = Me
no.RunMethod("removeNotif", Null)
Sleep(300)
'processRemoteNotification(Message) '<- do your processing here.
CompletionHandler.Complete
End Sub
#if OBJC
#import <UserNotifications/UserNotifications.h>
-(void)removeNotif {
// Remove all notifications.
[[UNUserNotificationCenter currentNotificationCenter] removeAllDeliveredNotifications];
}
#end if[/CODE]
It's curious because, at least now, even when the app is killed I'm receiving these notifications and they are immediately delivered to the app. So they are processed even in this case. But we can't rely that this will be always the behavior.