DXNotificationClient
This class is responsible for registering for Push Notifications and making requests to the DX notifications API.
The DXNotificationClient
class simplifies registering your app for Apple Push Notifications and allows you to create and send notifications between users. Notifications can be ephemeral or persisted, in which case you will be able to request those persisted notifications. To use push notifications, you will need to enable it in your app. Take a look at the Enabling the Push Notification Service section from this tutorial for more information.
You will need to enable the "Push Notifications" scope for your app in the developer dashboard before using the notifications API.
Properties
Singleton instance of DXNotificationClient
. You will access all the available DXNotificationClient
methods through this instance.
Methods
register
Register your app for Apple Push Notifications. If you are already using push notifications in your app, you can simply pass in your existing device token.
If you pass in a device token but there is no currently authenticated user, an assertion will be raised.
didRegisterForRemoteNotifications
Handles device token registration. Your AppDelegate
will need to implement the application(_:didRegisterForRemoteNotificationsWithDeviceToken:)
method, which will then invoke the didRegisterForRemoteNotifications
method, passing in the deviceToken
argument.
createNotification
Create and send a push notification to another DX user.
readNotifications
Request all persisted notifications for the current user. Supports pagination through the page
and limit
parameters.
acknowledgeNotification
Acknowledge that a notification has been seen by the current user.
Last updated