Push notification, android and ios

Is there an example of how to use push notifications with Android and iOS?

I don’t believe that the parts of the framework necessary for handling remote notifications in Android exist yet.

As far as iOS goes, you need to add the Notifications object to your project and then do these things:

  1. In App.Opening, call NotificationCenter.RegisterForRemoteNotifications
  2. In NotificationCenter, implement the RemoteRegistrationSucceeded event so you can get the notification token.

The token will need to be stored on a server somewhere, with some other identifier for the user. It’s important to remember that user’s can have more than one device these days, so you’ll probably need a way to store more than one token.

Please note that tokens can change at any time. When your app launches, you should send whatever value you get to your server so that you have the most recent token at any given time.

In terms of sending remote notifications, there are services around which can do that for you. Xojo Cloud also has the ability to communicate with APNS to send them as well, and there’s an example in Xojo’s examples for that.

1 Like

Did you mean something like that?

dim mpm as MobilePopupMessage
mpm.Show "Ciao bella!", MobilePopupMessage.Durations.Short

Io parlavo di push notification non di messaggi popup

Le push notification partono da un server ed arrivano ai dispositivi (in realtà è al contrario ma rende l’ idea )