# Push Notification

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`.

#### Parameters:

* `deviceToken`: user's deviceToken ID

To set the push notification token to DriveSync, the following API can be used.

### Concrete example

{% tabs %}
{% tab title="Swift" %}

```swift
let service = PushNotificationService()
service.setToken(deviceToken: deviceToken, then: { result in
    switch result {
    case .success(_):
        // passing token successful
        break
    default:
        // error
    }
})
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val service = PushNotificationService()
service.setToken(deviceToken) { result: Result<Content?>? ->
    if (result?.value == null || result.throwable != null) {
        // failure
    } else {
        // Success
        val content = result.value
    }
})
```

{% endtab %}
{% endtabs %}
