Comment on page

Push Notification

Handles Push Notification related requests with IMS web services. Unless otherwise specified, requests performed by this service are on the current Device.
The PushNotification uses the Device API and it is seperated from Device module considering any new features may be implemented in future to expand PushNotificationService.

Required information

*Identity: In order to set push notification token for the device, the application must have a valid user (represented by the Identity). That user must be active.


  • deviceToken: user's deviceToken ID

Concrete example

To set the push notification token to DriveSync, one can use following snippet
let service = PushNotificationService(identity: identity)
service.setToken(deviceToken: deviceToken, then: { result in
switch result {
case .success(_):
// passing token successful
// error
val service = PushNotificationService(identity)
service.setToken(deviceToken) { result: Result<Content?>? ->
if (result?.value == null || result.throwable != null) {
// failure
} else {
// Success
val content = result.value