Kore.ai supports sending push notifications to mobile devices over the Mobile SDK channel.
Kore mobile SDKs get embedded with the native host mobile application, which is responsible for managing push notification subscriptions with an APNS and GCM provider. The Host Mobile application server needs to host a webhook to receive updates from Kore.ai. It sends these updates as push notifications to the devices.
Registering for Push Notification
To enable Push Notifications for your app, follow the steps below:
- In the XO Platform, go to Deploy > Channels > Web/Mobile SDK.
- In the Web/Mobile SDK channel window, select Configure.
- Enable the Web/Mobile Client if it is not enabled.
- Expand App Details and select the app that you want to enable Push Notifications For.
- You can register your app at this point, by clicking Add. See SDK App Registration for details about registering an app with the XO Platform via the SDK.
- If your app is already registered, select it and click Edit.
- On the Create/Edit APP screen, click the Enable checkbox.
- In the box below, enter a URL to which the push notification should be sent.
User Device Registration
For each user who opts to receive the notification, the Mobile Application needs to send the device and user details to Kore.ai. Kore.ai sends device details and the user ID while making the webhook call.
Subscription API
- Endpoint
POST https://bots.kore.ai/api/users/:userId/sdknotifications/subscribe - Authorization Header
authorization: “bearer xxxxxxxxxxxxxxx”
- Payload
{deviceId : , (required) osType : ios / android (required) }
- Sample Request
curl -X POST \ https://bots.kore.ai/api/users/u-46b5fdXXXXXXXXX-4b85347a38ea/sdknotifications/subscribe \ -H 'authorization: bearer jmABumfQUt8AaMXXXXXXXXXXXXXXXXXz0hsvVI' \ -H 'content-type: application/json' \ -d ' { "deviceId" : "device123", "osType" : "ios" }'
Unsubscription API
- Endpoint
DELETE https://bots.kore.ai/api/users/:userId/sdknotifications/unsubscribe - Authorization Header
authorization: “bearer xxxxxxxxxxxxxxx”
- Payload
{deviceId : , (required) osType : ios / android (required) }
- Sample Request
curl -X DELETE \ https://bots.kore.ai/api/users/u-46b5fdXXXXXXXXX-4b85347a38ea/sdknotifications/unsubscribe \ -H 'authorization: bearer jmABumfQUt8AaMXXXXXXXXXXXXXXXXXz0hsvVI' \ -H 'content-type: application/json' \ -d ' { "deviceId" : "device123", "osType" : "ios" }'