curl --request PUT \
--url https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}
'{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}Push notification : Update the settings for Push notifications extension.
curl --request PUT \
--url https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}
'{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}AppID in which the extension has to be enabled/disabled
Show child attributes
2: Token-based (Recommended) | 0: Topic-based + Token-based | 1: Topic-based (Legacy)
1: FCM | 2: APNs | 0: FCM+APNs
Show child attributes
Include 'notification' key for Web
Include 'notification' key for Android
Include 'notification' key for Ionic
Include 'notification' key for React native
Include 'notification' key for iOS
Include 'notification' key for Flutter
Required for APNs only. Use .p8 as it never expires
Required for APNs only
Required for APNs only
Required for APNs only
Required for APNs only. 'true' for apps available on the Appstore
Optional property
Show child attributes
Excludes sender's metadata from the message object in the push payload
Excludes receiver's metadata from the message object in the push payload
Excludes the message metadata from the message object in the push payload
Trims the message text from the message object in the push payload to ensure the payload size does not exceed 4KB; exceeding this limit may prevent notifications from being delivered.
Update Push Notification Settings
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
2: Token-based (Recommended) | 0: Topic-based + Token-based | 1: Topic-based (Legacy)
1: FCM | 2: APNs | 0: FCM+APNs
Show child attributes
Include 'notification' key for Web
Include 'notification' key for Android
Include 'notification' key for Ionic
Include 'notification' key for React native
Include 'notification' key for iOS
Required for APNs only. Use .p8; as it never expires
Required for APNs only.
Required for APNs only.
Required for APNs only.
Required for APNs only. 'true' for apps available on the Appstore
Was this page helpful?