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.
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 multipart/form-data content type, specifies the name of a .p12 file. Sendbird server scans the content of the file, determines the certificate type, then registers the file as its corresponding type. If you upload a wrong file, you will receive an error.
Optional
Type
Description
apns_cert_env_type
string
Specifies the environment type of the .p12 certificate file. Acceptable values are either development or production. There is no need to specify this property when the apns_cert above is specified.
apns_cert_password
string
Specifies the password of the certificate file which has been set during the .p12 file export.
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 Library/Sounds folder of the app's data container.
apns_type
string
(Deprecated) Specifies the certificate type of the .p12 file. Acceptable values are development and production. You should specify either this property or the apns_cert above to inform the server of which certificate type to update.
HTTPPythoncURL
Content-Type: multipart/form-data; boundary={your_unique_boundary_string}
Content-Length: {length of content}
--{your_unique_boundary_string}
Content-Disposition: form-data; name="has_unread_count_badge"
[boolean]
--{your_unique_boundary_string}
Content-Disposition: form-data; name="apns_cert"; filename="push_notification_certificate.p12"
Content-Type: application/x-pkcs12
[binary contents of the certificate]
--{your_unique_boundary_string}--
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 and Production 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.
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.
The following table lists the properties of an HTTP request that this action supports.
Properties
Required
Type
Description
apns_key_id
string
Specifies the Key ID provided to your authentication key.
apns_team_id
string
Specifies the Team ID of your team in Apple Developer account.
apns_bundle_id
string
Specifies the Bundle ID for your application.
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 .p12 file and token for a .p8 file.
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 Library/Sounds folder of the app's data container.
HTTPPythoncURL
Content-Type: multipart/form-data; boundary={your_unique_boundary_string}
Content-Length: {length of content}
--{your_unique_boundary_string}
Content-Disposition: form-data; name="has_unread_count_badge"
[boolean]
--{your_unique_boundary_string}
Content-Disposition: form-data; name="apns_auth_type"
token
--{your_unique_boundary_string}
Content-Disposition: form-data; name="apns_key_id"
[key id for the p8 key]
--{your_unique_boundary_string}
Content-Disposition: form-data; name="apns_team_id"
[team id from apple developer console]
--{your_unique_boundary_string}
Content-Disposition: form-data; name="apns_bundle_id"
[bundle id of your application]
--{your_unique_boundary_string}
Content-Disposition: form-data; name="apns_environment"
[PRODUCTION or DEVELOPMENT]
--{your_unique_boundary_string}
Content-Disposition: form-data; name="apns_cert"; filename="push_notification_certificate.p8"
Content-Type: application/pkcs8
[binary contents of the certificate]
--{your_unique_boundary_string}--