Apple Push Notification Service APNS
Push Notification

1. Register App Push Notifications
First, the App must obtain a
token from the APNS
(Apple Push Notification
Service).
The APNS is a service provided by
Apple that takes care of the security and integrity of the data.
The request for the app-token to
the APNS, i.e. the token that uniquely identifies your app, is made from the
app using the UNUserNotificationCenter class. In order for the app to be able
to receive push notifications at all, the switch for push notifications must be
activated in the capability settings.
This results in the App Id being
updated for Push Notifications and a new Provisioning Profile being created as
long as automatic-signing is activated.
In the case of manual
administration, the provisioning profile would have to be updated in this case.
The request can now be made to
the APNS.
As I already said, for this the
class UNUserNotificationCenter can be used.
As you can see, you can pass
different options to this method. Currently, the badge alert and sound options
are sufficient for us. If the user agrees, the app should request the app token
via registerForRemoteNotifications.
After the registration is completed
the app receives a token. This token is volatile and should not be cached in
the app. The token is only valid as long as the user does not reinstall the app
or restore the device. The Token will be provided through a different method
which will be described in the next section.
Comments
Post a Comment