Add an APNs push configuration
Registers an APNs (Apple Push Notification service) push configuration for client apps. To send push notifications to iOS devices, you should first register the APNs push configuration. You can also register the configurations on the Sendbird Dashboard under Settings > Chat > Push notifications.
Note: Now you can use a
.p8
file as an authentication token to send push notifications through APNs. Export the token and register it on the Sendbird Dashboard. To learn more about the token-based connection to APNs, visit Apple Developer's Documentation.
Register a .p12
certificate
You can register a .p12
certificate file to Sendbird server using the following end point.
Note: To upload a
.p12
file to Sendbird server, you should send a Multipart request.
HTTP request
Request body
The following table lists the properties of an HTTP request that this action supports.
Properties
Required | Type | Description |
---|---|---|
apns_cert | file | In a form of the |
Optional | Type | Description |
---|---|---|
apns_cert_env_type | string | Specifies the environment type of the |
apns_cert_password | string | Specifies the password of the certificate file which has been set during the |
has_unread_count_badge | boolean | Determines whether to badge the client app's icon with the number of a user's unread messages. (Default: true) |
content_available | boolean | Determines whether to send a silent notification and perform background update for the app on a user's device. For more information, see the Apple Developer Documentation's Pushing Updates to Your App Silently. (Default: false) |
mutable_content | boolean | Determines whether to modify the payload of a push notification before it is displayed on a user's device. For more information, see the Apple Developer Documentation's Modifying Content in Newly Delivered Notifications. (Default: false) |
push_sound | string | Specifies the name of a sound file to be played when a push notification is delivered to the client app. The file can be in the app's main bundle or in the |
| string | (Deprecated) Specifies the certificate type of the |
Note: If you can't upload your
.p12
file to Sendbird server using the Chat Platform API or the Sendbird Dashboard, it might be some buggy behavior caused by the Keychain Access on your Mac.If you use a single CSR file which you previously uploaded to Apple Developer Member Center, you might receive the same CSR file even when requesting separate files for
Development
andProduction
stages. To solve this problem, you must generate another CSR file and upload it to Apple Developer Member Center. Then, export a.p12
file again, and upload the new file to Sendbird server.
Response
If successful, this action returns the information about the registered APNs push configuration in the response body.
List of response properties
Property name | Type | Description |
---|---|---|
push_configurations[] | array of objects | A list of either FCM or APNs push configurations. |
push_configurations.(provider).id | string | A unique provider ID that identifies the push configuration. This is automatically generated by Sendbird. |
push_configurations.(provider).push_type | string | The type of the push configuration. |
push_configurations.(provider).apns_cert_env_type | string | The certificate type of the |
push_configurations.(provider).apns_expiration | string | The type of the push configuration which is either development or production. |
push_configurations.(provider).apns_name | string | The name of the certificate. |
push_configurations.(provider).has_unread_count_badge | int | Indicates whether to badge the client app's icon with the number of a user's unread messages. A value of 1 indicates that the number of a user's unread messages is badged with the icon. |
push_configurations.(provider).content_available | boolean | Indicates for the client app whether to perform a silent background update on a user's device. |
push_configurations.(provider).mutable_content | boolean | Indicates for the client app whether to modify the payload of a push notification before it is displayed on a user's device. |
push_configurations.(provider).push_sound | string | The name of a sound file to be played when a push notification is delivered to the client app. |
Register a .p8
file as an authentication token
You can register a .p8
file as an authentication token to Sendbird server using the following end point.
Note: To upload a
.p8
file to Sendbird server, you should send a Multipart request.
HTTP request
Request body
The following table lists the properties of an HTTP request that this action supports.
Properties
Required | Type | Description |
---|---|---|
apns_key_id | string | Specifies the |
apns_team_id | string | Specifies the |
apns_bundle_id | string | Specifies the |
apns_environment | string | Specifies which APNs server to use. Acceptable values are either production or development. |
apns_auth_type | string | Specifies which credentials you will use when communicating with APNs. Acceptable values are certificate for a |
Optional | Type | Description |
---|---|---|
has_unread_count_badge | boolean | Determines whether to badge the client app's icon with the number of a user's unread messages. (Default: true) |
content_available | boolean | Determines for the client app whether to perform a silent background update on a user's device. For more information, see the Apple Developer Documentation's Pushing Updates to Your App Silently. (Default: false) |
mutable_content | boolean | Determines for the client app whether to modify the payload of a push notification before it is displayed on a user's device. For more information, see the Apple Developer Documentation's Modifying Content in Newly Delivered Notifications. (Default: false) |
push_sound | string | Specifies the name of a sound file to be played when a push notification is delivered to the client app. The file can be in the app's main bundle or in the |
Response
If successful, this action returns the information about the registered APNs push configuration in the response body.
List of response properties
Property name | Type | Description |
---|---|---|
push_configurations.(provider).apns_key_id | string | A unique ID allocated to the registered authentication key. This property appears only when the registered credentials is a |
push_configurations.(provider).apns_team_id | string | A unique ID allocated to the team your Apple Developer account belongs to. This property appears only when the registered credentials is a |
In the case of an error, an error object is returned. A detailed list of error codes is available here.