[Tutorial][Messaging][Push] Added Multiple Request & Multicast
authorYounho Park <younho.park@samsung.com>
Wed, 23 Dec 2015 07:25:43 +0000 (16:25 +0900)
committerYounho Park <younho.park@samsung.com>
Wed, 23 Dec 2015 07:25:43 +0000 (16:25 +0900)
Change-Id: I1c464a228029a130edda2fba77e2094dc26d8103
Signed-off-by: Younho Park <younho.park@samsung.com>
org.tizen.tutorials/html/native/messaging/push_tutorial_n.htm

index d9ce771..68d9a7a 100644 (file)
@@ -552,7 +552,16 @@ push_service_deregister(push_conn, _dereg_result_cb, NULL);
 <p>The message field takes effect only when the application is not running (more precisely, when the application is not connected to the push service.) If a notification with the above message field arrives at the device where the application is running, the push service delivers the notification directly to the application, neither showing the &quot;Hi&quot; message in the quick panel nor increasing the badge count.</p>
 </li>
 
-<li>Send notifications.
+
+
+
+
+
+
+<li>Rest APIs for sending push notifications.
+<ol>
+<li>Single request
+
 <p>With the created message field, you can construct a notification using a JSON query and send it to the RQM server using the POST method. The following list contains the details:</p>
 <ul>
 <li>URI: URI of the RQM server chosen based on the first 2 digits of the registration ID</li>
@@ -780,6 +789,259 @@ appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
 </li>
 </ul>
 </li>
+
+
+
+
+
+<li> Multiple Request
+<p>You can construct a Multiple Request in a RestAPI call. The following list contains the details:</p>
+<ul>
+<li>URI: URI of the RQM server chosen based on the first 2 digits of the registration ID</li>
+<li>Method: POST</li>
+<li>Data: JSON </li>
+<li>Description: Request a notification push to a push client</li>
+<li>Argument: Refer to single request</li>
+<li>Note: Total request message body must be less than the system default value, 200 kb. If not, &quot;3034 – error of too long chuned message data&quot; is returned. System default value can be changed as needed.</li>
+<li>Example header:
+<pre class="prettyprint">
+appID: 1234567890987654
+appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
+</pre></li>
+
+<li>Example request:
+<pre class="prettyprint lang-html">
+{
+&nbsp;&nbsp;&nbsp;&quot;messages&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;encoding&quot; : &quot;base64&quot; &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot; : &quot;ab123456&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot; : &quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sender&quot; : &quot;oscal&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;type&quot; : 0 &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;message&quot; : &quot;example&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;appData&quot; : &quot;{id:asdf&amp;passwd:1234}&quot;, &lt;!--Optional, (Opaque)--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;expiryDate&quot; : 720, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;delayDate&quot; : 60, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;reliableOption&quot; : &quot;Transport&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sessionInfo&quot; : &quot;192.168.0.1-8080-12345567&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;timeStamp&quot; : 1234567890, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;connectionTerm&quot; : 0, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp; }
+&nbsp;&nbsp;&nbsp; {
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;encoding&quot; : &quot;base64&quot; &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot; : &quot;ab234567&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot; : &quot;0000002&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sender&quot; : &quot;oscal&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;type&quot; : 0 &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;message&quot; : &quot;example&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;appData&quot; : &quot;{id:asdf&amp;passwd:1234}&quot;, &lt;!--Optional, (Opaque)--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;expiryDate&quot; : 720, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;delayDate&quot; : 60, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;reliableOption&quot; : &quot;Transport&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sessionInfo&quot; : &quot;192.168.0.1-8080-12345567&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;timeStamp&quot; : 1234567890, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;connectionTerm&quot; : 0, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;]}
+
+}
+</pre>
+</li>
+
+
+<li>Example response:
+<ul>
+<li>
+<p>The following example shows a response message when the request is successful:</p>
+<pre class="prettyprint">
+{
+&nbsp;&nbsp;&nbsp;&quot;results&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab123456&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:1000,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;Success&quot;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab234567&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000002&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:1000,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;Success&quot;
+&nbsp;&nbsp;&nbsp;}]
+}
+</pre>
+</li>
+<li>
+<p>The following example shows a response message when the request fails due to malformation:</p>
+<pre class="prettyprint">
+{
+&nbsp;&nbsp;&nbsp;&quot;results&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:3023,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;error of json mapping exception&quot;
+&nbsp;&nbsp;&nbsp;}]
+}
+</pre>
+</li>
+<li>
+<p>The following example shows a response message when some of multiple request are failed and the others are not:</p>
+<pre class="prettyprint">
+{
+&nbsp;&nbsp;&nbsp;&quot;results&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab123456&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:1000,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;Success&quot;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab234567&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000002&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:3008,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;error of not registered regID&quot;
+&nbsp;&nbsp;&nbsp;}]
+}
+</pre>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+
+
+<li> Multicast
+<p>You can construct a multicast to send a push notification to multiple applications. The following list contains the details:</p>
+<ul>
+<li>URI: URI of the RQM server chosen based on the first 2 digits of the registration ID</li>
+<li>Method: POST</li>
+<li>Data: JSON </li>
+<li>Description: Request a notification push to a push client</li>
+<li>Argument: Refer to single request</li>
+<li>Note: Total request message body must be less than the system default value, 200 kb. If not, &quot;3034 – error of too long chuned message data&quot; is returned. System default value can be changed as needed.</li>
+<li>Example header:
+<pre class="prettyprint">
+appID: 1234567890987654
+appSecret: dYo/o/m11gmWmjs7+5f+2zLNVOc=
+</pre></li>
+
+<li>Example request:
+<pre class="prettyprint lang-html">
+{
+&nbsp;&nbsp;&nbsp;&quot;messages&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;encoding&quot; : &quot;base64&quot; &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot; : [&quot;ab123456&quot;, &quot;ab234567&quot;, &quot;ab345678&quot;]
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot; : &quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sender&quot; : &quot;oscal&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;type&quot; : 0 &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;message&quot; : &quot;example&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;appData&quot; : &quot;{id:asdf&amp;passwd:1234}&quot;, &lt;!--Optional, (Opaque)--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;expiryDate&quot; : 720, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;delayDate&quot; : 60, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;reliableOption&quot; : &quot;Transport&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;sessionInfo&quot; : &quot;192.168.0.1-8080-12345567&quot;, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;timeStamp&quot; : 1234567890, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;connectionTerm&quot; : 0, &lt;!--Optional--&gt;
+&nbsp;&nbsp;&nbsp;]}
+
+}
+</pre>
+</li>
+
+<li>Example response:
+<ul>
+<li>
+<p>The following example shows a response message when the request is successful:</p>
+<pre class="prettyprint">
+{
+&nbsp;&nbsp;&nbsp;&quot;results&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab123456&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:1000,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;Success&quot;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab234567&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000002&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:1000,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;Success&quot;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab345678&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000002&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:1000,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;Success&quot;
+&nbsp;&nbsp;&nbsp;}]
+}
+</pre>
+</li>
+<li>
+<p>The following example shows a response message when the request fails due to malformation:</p>
+<pre class="prettyprint">
+{
+&nbsp;&nbsp;&nbsp;&quot;results&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:3023,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;error of json mapping exception&quot;
+&nbsp;&nbsp;&nbsp;}]
+}
+</pre>
+</li>
+<li>
+<p>The following example shows a response message when some of multiple request are failed and the others are not:</p>
+<pre class="prettyprint">
+{
+&nbsp;&nbsp;&nbsp;&quot;results&quot;:
+&nbsp;&nbsp;&nbsp;[{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab123456&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:1000,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;Success&quot;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab234567&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:3008,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;error of not registered regID&quot;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;regID&quot;:&quot;ab345678&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;requestID&quot;:&quot;0000001&quot;,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusCode&quot;:3013,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;statusMsg&quot;:&quot;error of impossible to enqueue&quot;
+&nbsp;&nbsp;&nbsp;}]
+}
+</pre>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ol>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 </ol>
 
  <h2 id="receive_push" name="receive_push">Receiving Push Notifications</h2>