Sub TestGetMessage As String
Dim msg As String = "hi there!"
Return msg
End Sub
Private Sub Application_RemoteNotification (Message As Map, CompletionHandler As CompletionHandler)
'Log($"Message arrived: ${Message}"$)
'Msgbox(Message, Message.Get("body"))
Dim no As NativeObject = Me
no.RunMethod("removeNotif", Null)
Sleep(300)
Dim ln As Notification
ln.Initialize(DateTime.Now + 10 * DateTime.TicksPerSecond)
'ln.IconBadgeNumber = 1
ln.AlertBody = TestGetMessage
ln.PlaySound = True
ln.Register
CompletionHandler.Complete
End Sub
#if OBJC
#import <UserNotifications/UserNotifications.h>
-(void)removeNotif {
// Remove all notifications.
[[UNUserNotificationCenter currentNotificationCenter] removeAllDeliveredNotifications];
}
#end if