{"id":18044,"date":"2018-03-20T13:23:19","date_gmt":"2018-03-20T13:23:19","guid":{"rendered":"http:\/\/developer.kore.ai\/v10-1\/?post_type=docs&#038;p=13546"},"modified":"2022-10-05T06:41:34","modified_gmt":"2022-10-05T05:41:34","slug":"mobile-sdk-push-notification","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/sdks\/mobile-sdk-push-notification\/","title":{"rendered":"Mobile SDK Push Notification"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Kore.ai supports sending push notifications to mobile devices over the Mobile SDK channel.<\/span><\/p>\n<p><span style=\"font-weight: 400\">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.<\/span><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Registering_for_Push_Notification\"><span style=\"font-weight: 400\">Registering for Push Notification<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">To enable Push Notifications for your app, <\/span><span style=\"font-weight: 400\">follow the steps below:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In the XO Platform, go to <\/span><strong>Deploy &gt; Channels &gt; Web\/Mobile SDK<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In the Web\/Mobile SDK channel window, select <\/span><strong>Configure<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Enable the <\/span><strong>Web\/Mobile Client <\/strong><span style=\"font-weight: 400\">if it is not enabled.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Expand <\/span><strong>App Details<\/strong><span style=\"font-weight: 400\"> and <\/span><strong>select the app<\/strong><span style=\"font-weight: 400\"> that you want to enable Push Notifications For.\u00a0<\/span><\/li>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can register your app at this point, by clicking <\/span><strong>Add<\/strong><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">See <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/sdks\/sdk-app-registration\/\"><span style=\"font-weight: 400\">SDK App Registration<\/span><\/a><span style=\"font-weight: 400\"> for details about registering an app with the XO Platform via the SDK.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">If your app is already registered, select it and click <\/span><strong>Edit<\/strong><span style=\"font-weight: 400\">.\u00a0<\/span><\/li>\n<\/ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the <\/span><em><span style=\"font-weight: 400\">Create\/Edit APP <\/span><\/em><span style=\"font-weight: 400\">screen, click the <\/span><strong>Enable<\/strong><span style=\"font-weight: 400\"> checkbox.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In the box below, enter a URL to which the push notification should be sent.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\"><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221005063703\/enable-notifications.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-48134\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221005063703\/enable-notifications.png\" alt=\"\" width=\"559\" height=\"543\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221005063703\/enable-notifications.png 738w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221005063703\/enable-notifications-300x291.png 300w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/a><\/span><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"User_Device_Registration\"><span style=\"font-weight: 400\">User Device Registration<\/span><\/span><\/h2>\n<p>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.<\/p>\n<h4>Subscription API<\/h4>\n<ul>\n<li><strong>Endpoint<\/strong><br \/>\n<table>\n<tbody>\n<tr>\n<td><strong>POST<\/strong><\/td>\n<td>https:\/\/bots.kore.ai\/api\/users\/:userId\/sdknotifications\/subscribe<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li><strong>Authorization Header<\/strong> <code> authorization: \u201cbearer xxxxxxxxxxxxxxx\u201d <\/code><\/li>\n<li><strong>Payload<\/strong>\n<pre class=\"\">{deviceId : , (required)\r\nosType : ios  \/ android  (required)\r\n}<\/pre>\n<\/li>\n<li><strong>Sample Request<\/strong>\n<pre class=\"\">curl -X POST \\\r\n  https:\/\/bots.kore.ai\/api\/users\/u-46b5fdXXXXXXXXX-4b85347a38ea\/sdknotifications\/subscribe \\\r\n  -H 'authorization: bearer jmABumfQUt8AaMXXXXXXXXXXXXXXXXXz0hsvVI' \\\r\n  -H 'content-type: application\/json' \\\r\n  -d '  {\r\n         \"deviceId\" : \"device123\",\r\n         \"osType\" : \"ios\"\r\n          }'<\/pre>\n<\/li>\n<\/ul>\n<h4>Unsubscription API<\/h4>\n<ul>\n<li><strong>Endpoint<\/strong><br \/>\n<table>\n<tbody>\n<tr>\n<td><strong>DELETE<\/strong><\/td>\n<td>https:\/\/bots.kore.ai\/api\/users\/:userId\/sdknotifications\/unsubscribe<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li><strong>Authorization Header<\/strong> <code> authorization: \u201cbearer xxxxxxxxxxxxxxx\u201d <\/code><\/li>\n<li><strong>Payload<\/strong>\n<pre>     {deviceId : , (required)\r\n      osType : ios  \/ android  (required)\r\n     }<\/pre>\n<\/li>\n<li><strong>Sample Request<\/strong>\n<pre class=\"\">curl -X DELETE \\\r\n  https:\/\/bots.kore.ai\/api\/users\/u-46b5fdXXXXXXXXX-4b85347a38ea\/sdknotifications\/unsubscribe \\\r\n  -H 'authorization: bearer jmABumfQUt8AaMXXXXXXXXXXXXXXXXXz0hsvVI' \\\r\n  -H 'content-type: application\/json' \\\r\n  -d '  {\r\n         \"deviceId\" : \"device123\",\r\n         \"osType\" : \"ios\"\r\n         }'<\/pre>\n<\/li>\n<\/ul>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-18044","post","type-post","status-publish","format-standard","hentry","category-sdks"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=18044"}],"version-history":[{"count":5,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18044\/revisions"}],"predecessor-version":[{"id":48139,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18044\/revisions\/48139"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=18044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=18044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=18044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}