Send push notifications to Apple's APN server

Does anyone have experience or tips on how I can send push notifications directly from Xojo to Apple? So with HTTP2.

Do you have a Xojo Cloud account?
If so, maybe this blog post may help:

The trick is that you need to create a signed jwt using an encryption method that is not included in Xojo, so you can’t get there directly.

Keep in mind that there’s also additional infrastructure and code that you’ll need.

  • when your app launches, it needs to request a remote notification token. This token needs to be stored on your server somewhere and associated with the user’s instance of your app so you can remove it if they opt out later. This token can also change from time to time so you should also store a local hash and upload a new token if it ever changes.
  • if your app has more than one type of remote notification, you’ll have to manage those preferences both in the app as well as on your back end.
  • remote notifications don’t automatically appear if your app is running. Your app is given a chance to intercept it and not show anything if the information is no longer relevant for instance.
1 Like

I have had a push server for many years. It manages the push tokens and cients and sends the push notifications to Apple via OneSignal. The push notifications are sent to individual clients. Not to all of them.

However, restrictions are to be expected in the future, so I would like to send the push notifications directly to Apple.

The only thing missing is HTTP2 communication with Apple’s APN.