> ## Documentation Index
> Fetch the complete documentation index at: https://social-b97141fb-feat-user-history-moderation-detail.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Device Registration

> Register and unregister a device for push notifications with the current SDK APIs.

Device registration connects the current signed-in user to the device token that the operating system gives your app. Use it after your app has completed the platform push-notification setup and after the SDK client is initialized for a signed-in user.

<Warning>
  The TypeScript SDK does not expose a client-side device registration API. Use the native iOS, Android, or Flutter SDK APIs on device, and use server-side/webhook flows for web delivery.
</Warning>

## Platform Surface

| Platform | Register | Unregister | Token argument |
| - | - | - | - |
| iOS | `client.registerPushNotification(withDeviceToken:)` | `client.unregisterPushNotification()` | `token: String` |
| Android | `AmityCoreClient.registerPushNotification()` | `AmityCoreClient.unregisterPushNotification()` | None |
| Flutter | `AmityCoreClient.registerDeviceNotification(fcmToken)` | `AmityCoreClient.unregisterDeviceNotification()` | `fcmToken: String` |
| TypeScript | Not available | Not available | Not available |

## Parameters

| Name | Platform | Type | Required | Description |
| - | - | - | - | - |
| `token` | iOS | `String` | Yes | APNs device token passed to `registerPushNotification(withDeviceToken:)`. |
| `fcmToken` | Flutter | `String` | Yes | FCM token passed to `registerDeviceNotification`. |

Android registration does not accept a token argument in the current SDK API. The Android SDK registers the current signed-in user/device through `AmityCoreClient.registerPushNotification()`.

## Register A Device

Register the current signed-in user/device after platform push setup and SDK initialization are complete.

<CodeGroup>
  ```swift iOS theme={null}
  try await client.registerPushNotification(withDeviceToken: "<device-token>")
  ```

  ```kotlin Android theme={null}
  AmityCoreClient.registerPushNotification()
      .doOnComplete {
          // Device registration completed.
      }
      .doOnError { error ->
          // Handle registration error.
      }
      .subscribe()
  ```

  ```dart Flutter theme={null}
  await AmityCoreClient.registerDeviceNotification(fcmToken);
  ```
</CodeGroup>

<Note>
  On Android, `registerPushNotification()` is a no-op for visitor and bot users. Register only after the app has a signed-in user session.
</Note>

## Unregister A Device

Call unregister when the user signs out or when this app installation should stop receiving push notifications for the currently registered user.

<CodeGroup>
  ```swift iOS theme={null}
  try await client.unregisterPushNotification()
  ```

  ```kotlin Android theme={null}
  AmityCoreClient.unregisterPushNotification()
      .doOnComplete {
          // Device unregistration completed.
      }
      .doOnError { error ->
          // Handle unregistration error.
      }
      .subscribe()
  ```

  ```dart Flutter theme={null}
  await AmityCoreClient.unregisterDeviceNotification();
  ```
</CodeGroup>

## Related Setup

Complete platform setup before calling the SDK registration API:

* [iOS Setup](./setup/ios-setup)
* [Android Setup](./setup/android-setup)
* [Flutter Setup](./setup/flutter-setup)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.