Adds a user's registration or device token to Sendbird Server. Registering tokens to Sendbird server allows sending notification requests to push notification services on behalf of your server. You can pass gcm, huawei, or apns for FCM registration token, HMS device token, or APNs device token, respectively, in the token_type parameter for push notification service you are using. A user can have up to 20 tokens per service and the token that was registered earliest will be deleted before a new one is added when the user already has 20 tokens registered.
If you need to register the token via your own server, you can do so with FCM registration token and an APNs device token which are generated and registered by Android and iOS client apps through the corresponding SDKs and allow identification of each client app instance on each device.
Note: For more information on the registration token and device token, visit the Google's FCM page, Huawei's Push kit and Apple's APNs page.
HTTP request
POST https://api-{application_id}.sendbird.com/v3/users/{user_id}/push/{token_type}
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name
Type
Description
user_id
string
Specifies the unique ID of a user.
token_type
string
Specifies the type of a token. Acceptable values are gcm, huawei, and apns for FCM, HMS, and APNS respectively.
Request body
The following table lists the properties of an HTTP request that this action supports.
Required
Property name
Type
Description
gcm_reg_token
string
Specifies a registration token for Firebase Cloud Messaging which was formerly known as Google Cloud Messaging.
huawei_device_token
string
Specifies a device token for Huawei Mobile Services.
apns_device_token
string
Specifies a device token for Apple Push Notification Service.