From: Lukasz Bardeli Date: Wed, 10 May 2017 07:54:35 +0000 (+0200) Subject: [Push] Adjust html to new standards X-Git-Tag: GitHub/PR#40/tizen-studio~166^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79649eb29476909ef1b260f7d941423a654a745b;p=sdk%2Fonline-doc.git [Push] Adjust html to new standards Change-Id: I643cde5c11ca125454bccf92254ada907c886b7a Signed-off-by: Lukasz Bardeli --- diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/push.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/push.html index 5d1c89c..d907a51 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/push.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/push.html @@ -93,13 +93,9 @@ Push service does not guarantee delivery and order of push messages. PushManager -
void registerService (ApplicationControl appControl, PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback)
void register (PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback)
-
void unregisterService (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
void unregister (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
-
void connectService (PushNotificationCallback notificationCallback)
void connect (PushRegistrationStateChangeCallback stateChangeCallback, PushNotificationCallback notificationCallback, optional ErrorCallback? errorCallback)
-
void disconnect ()
PushRegistrationId getRegistrationId ()
@@ -186,24 +182,14 @@ The tizen.push object allows access to the functionality of the Push AP The PushManager interface provides methods to manage push registration and notification.
    [NoInterfaceObject] interface PushManager {
-      void registerService(ApplicationControl appControl, PushRegisterSuccessCallback successCallback,
-                  optional ErrorCallback? errorCallback) raises(WebAPIException);
-
       void register(PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void unregisterService(optional SuccessCallback? successCallback,
-                    optional ErrorCallback? errorCallback) raises(WebAPIException);
-
       void unregister(optional SuccessCallback? successCallback,
                       optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void connectService(PushNotificationCallback notificationCallback) raises(WebAPIException);
-
       void connect(PushRegistrationStateChangeCallback stateChangeCallback,
                    PushNotificationCallback notificationCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void disconnectService() raises(WebAPIException);
-
       void disconnect() raises(WebAPIException);
 
       PushRegistrationId getRegistrationId() raises(WebAPIException);
@@ -302,13 +288,13 @@ var service = new tizen.ApplicationControl("http://tizen.org/appcontrol/operatio
 /* Defines the error callback */
 function errorCallback(response)
 {
-   console.log('The following error occurred: ' + response.name);
+  console.log("The following error occurred: " + response.name);
 }
 
 /* Defines the registration success callback */
 function registerSuccessCallback(id)
 {
-   console.log("Registration succeeded with id: " + id);
+  console.log("Registration succeeded with id: " + id);
 }
 
 /* Requests registration */
@@ -392,31 +378,31 @@ The connect() method must be called before calling the register()
 /* Defines the error callback */
 function errorCallback(response)
 {
-   console.log('The following error occurred: ' + response.name);
+  console.log("The following error occurred: " + response.name);
 }
 
 /* Defines the unregistration success callback */
 function unregisterSuccessCallback()
 {
-   console.log("Unregistration succeeded.");
+  console.log("Unregistration succeeded.");
 }
 
 /* Requests unregistration */
@@ -583,13 +569,13 @@ AbortError - If the operation cannot be finished properly.              
 /* Defines the error callback */
 function errorCallback(response)
 {
-   console.log("The following error occurred: " + response.name);
+  console.log("The following error occurred: " + response.name);
 }
 
 /* Defines the unregistration success callback */
 function unregisterSuccessCallback()
 {
-   console.log("Unregistration succeeded.");
+  console.log("Unregistration succeeded.");
 }
 
 /* Requests unregistration */
@@ -661,7 +647,7 @@ the registerService() method must be called before calling the conn
 /* Defines the connect success callback */
 function notificationCallback(noti)
 {
-   console.log("Notification received with alert message: " + noti.alertMessage);
+  console.log("Notification received with alert message: " + noti.alertMessage);
 }
 
 /* Defines the data to be used when this process is launched by notification service */
@@ -670,16 +656,16 @@ var service = new tizen.ApplicationControl("http://tizen.org/appcontrol/operatio
 /* Defines the error callback */
 function errorCallback(response)
 {
-   console.log("The following error occurred: " + response.name);
+  console.log("The following error occurred: " + response.name);
 }
 
 /* Defines the registration success callback */
 function registerSuccessCallback(id)
 {
-   console.log("Registration succeeded with id: " + id);
+  console.log("Registration succeeded with id: " + id);
 
-   /* Requests for push service connection */
-   tizen.push.connectService(notificationCallback);
+  /* Requests for push service connection */
+  tizen.push.connectService(notificationCallback);
 }
 
 /* Requests registration */
@@ -755,19 +741,19 @@ just after connection is established.
 /* Defines the state change callback */
 function stateChangeCallback(state)
 {
-   console.log("The state is changed to: " + state);
+  console.log("The state is changed to: " + state);
 }
 
 /* Defines the notification callback */
 function notificationCallback(notification)
 {
-   console.log("A notification arrives.");
+  console.log("A notification arrives.");
 }
 
 /* Defines the error callback */
 function errorCallback(error)
 {
-   console.log("The following error occurred: " + error.name);
+  console.log("The following error occurred: " + error.name);
 }
 
 /* Requests for push service connection */
@@ -904,7 +890,7 @@ tizen.push.disconnect();
 var registrationId = tizen.push.getRegistrationId();
 if (registrationId != null)
 {
-   console.log("The registration id: " + registrationId);
+  console.log("The registration id: " + registrationId);
 }
 
@@ -913,16 +899,16 @@ if (registrationId != null) /* Defines the state change callback */ function stateChangeCallback(state) { - console.log("The state is changed to: " + state); +  console.log("The state is changed to: " + state); - var id = tizen.push.getRegisterationId(); - console.log("The registration ID: " + id); +  var id = tizen.push.getRegisterationId(); +  console.log("The registration ID: " + id); } /* Defines the notification callback */ function notificationCallback(notification) { - console.log("A notification arrives."); +  console.log("A notification arrives."); } /* Requests for push service connection */ @@ -990,7 +976,7 @@ Once a missed push notification is retrieved the server deletes it from its data /* Defines the connect success callback */ function notificationCallback(message) { - console.log("New push message: " + message.alertMessage + ", date: " + message.date + ", data: " + message.appData); +  console.log("New push message: " + message.alertMessage + ", date: " + message.date + ", data: " + message.appData); } /* Requests for push service connection */ @@ -1003,19 +989,19 @@ tizen.push.getUnreadNotifications(); /* Defines the state change callback */ function stateChangeCallback(state) { - console.log("The state is changed to: " + state); +  console.log("The state is changed to: " + state); - if (state === "REGISTERED") - { - /* Gets unread push notifications */ - tizen.push.getUnreadNotifications(); - } +  if (state === "REGISTERED") +  { +    /* Gets unread push notifications */ +    tizen.push.getUnreadNotifications(); +  } } /* Defines the notification callback */ function notificationCallback(notification) { - console.log("A notification arrives."); +  console.log("A notification arrives."); } /* Requests for push service connection */ @@ -1077,12 +1063,12 @@ If the application was not launched by the push service, this method returns

Code example:

 try
 {
-   var message = tizen.push.getPushMessage();
-   console.log('Message received from: ' + message.sender);
+  var message = tizen.push.getPushMessage();
+  console.log("Message received from: " + message.sender);
 }
 catch (err)
 {
-   console.log('Exception - code: ' + err.name + ' message: ' + err.message);
+  console.log("Exception - code: " + err.name + " message: " + err.message);
 }
 
@@ -1197,24 +1183,31 @@ This data is the message that the sender wants to send and its length must be le

Code example:

+/* Defines the state change callback */
+function stateChangeCallback(state)
+{
+  console.log("The state is changed to: " + state);
+}
+
 /* Defines the connect success callback */
 function notificationCallback(noti)
 {
-   console.log('notification received on ' + noti.date + ' from: ' + noti.sender);
-   console.log('Details:');
-   console.log(' - data: ' + noti.appData);
-   console.log(' - alert message: ' + noti.alertMessage);
-   console.log(' - message: ' + noti.message);
-   console.log(' - session: ' + noti.sessionInfo);
-   console.log(' - request ID: ' + noti.requestId);
+  console.log("notification received on " + noti.date + " from: " + noti.sender);
+  console.log("Details:");
+  console.log(" - data: " + noti.appData);
+  console.log(" - alert message: " + noti.alertMessage);
+  console.log(" - message: " + noti.message);
+  console.log(" - session: " + noti.sessionInfo);
+  console.log(" - request ID: " + noti.requestId);
 }
 
 /* Requests for push service connection */
-tizen.push.connectService(notificationCallback);
+tizen.push.connect(stateChangeCallback, notificationCallback);
 
-

Output example:

 Notification received on Thu Jan 01 2015 from: xyz.AnotherApp
+

Output example:

 The state is changed to: REGISTERED
+ notification received on Thu Jan 01 2015 from: xyz.AnotherApp
  Details:
   - data: {id:asdf}
   - alert message: Hi
@@ -1397,24 +1390,14 @@ To guarantee that the push application runs on a device with the push feature, d
     Tizen implements PushManagerObject;
 
     [NoInterfaceObject] interface PushManager {
-      void registerService(ApplicationControl appControl, PushRegisterSuccessCallback successCallback,
-                  optional ErrorCallback? errorCallback) raises(WebAPIException);
-
       void register(PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void unregisterService(optional SuccessCallback? successCallback,
-                    optional ErrorCallback? errorCallback) raises(WebAPIException);
-
       void unregister(optional SuccessCallback? successCallback,
                       optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void connectService(PushNotificationCallback notificationCallback) raises(WebAPIException);
-
       void connect(PushRegistrationStateChangeCallback stateChangeCallback,
                    PushNotificationCallback notificationCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void disconnectService() raises(WebAPIException);
-
       void disconnect() raises(WebAPIException);
 
       PushRegistrationId getRegistrationId() raises(WebAPIException);
diff --git a/org.tizen.web.apireference/html/device_api/wearable/tizen/push.html b/org.tizen.web.apireference/html/device_api/wearable/tizen/push.html
index 1ba1a1f..5846ea4 100755
--- a/org.tizen.web.apireference/html/device_api/wearable/tizen/push.html
+++ b/org.tizen.web.apireference/html/device_api/wearable/tizen/push.html
@@ -93,13 +93,9 @@ Push service does not guarantee delivery and order of push messages.          
 PushManager
 
-
void registerService (ApplicationControl appControl, PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback)
void register (PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback)
-
void unregisterService (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
void unregister (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
-
void connectService (PushNotificationCallback notificationCallback)
void connect (PushRegistrationStateChangeCallback stateChangeCallback, PushNotificationCallback notificationCallback, optional ErrorCallback? errorCallback)
-
void disconnect ()
@@ -186,24 +182,14 @@ The tizen.push object allows access to the functionality of the Push AP The PushManager interface provides methods to manage push registration and notification.
    [NoInterfaceObject] interface PushManager {
-      void registerService(ApplicationControl appControl, PushRegisterSuccessCallback successCallback,
-                  optional ErrorCallback? errorCallback) raises(WebAPIException);
-
       void register(PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void unregisterService(optional SuccessCallback? successCallback,
-                    optional ErrorCallback? errorCallback) raises(WebAPIException);
-
       void unregister(optional SuccessCallback? successCallback,
                       optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void connectService(PushNotificationCallback notificationCallback) raises(WebAPIException);
-
       void connect(PushRegistrationStateChangeCallback stateChangeCallback,
                    PushNotificationCallback notificationCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
 
-      void disconnectService() raises(WebAPIException);
-
       void disconnect() raises(WebAPIException);
 
       PushRegistrationId getRegistrationId() raises(WebAPIException);
@@ -302,13 +288,13 @@ var service = new tizen.ApplicationControl("http://tizen.org/appcontrol/operatio
 /* Defines the error callback */
 function errorCallback(response)
 {
-   console.log('The following error occurred: ' + response.name);
+  console.log("The following error occurred: " + response.name);
 }
 
 /* Defines the registration success callback */
 function registerSuccessCallback(id)
 {
-   console.log("Registration succeeded with id: " + id);
+  console.log("Registration succeeded with id: " + id);
 }
 
 /* Requests registration */
@@ -392,31 +378,31 @@ The connect() method must be called before calling the register()
 /* Defines the error callback */
 function errorCallback(response)
 {
-   console.log('The following error occurred: ' + response.name);
+  console.log("The following error occurred: " + response.name);
 }
 
 /* Defines the unregistration success callback */
 function unregisterSuccessCallback()
 {
-   console.log("Unregistration succeeded.");
+  console.log("Unregistration succeeded.");
 }
 
 /* Requests unregistration */
@@ -554,7 +540,7 @@ AbortError - If the operation cannot be finished properly.              
                 
           
  • errorCallback [optional] [nullable]: - The method to be called when the unregistration request fails. + The callback to be called when the unregistration request fails.
  • @@ -583,13 +569,13 @@ AbortError - If the operation cannot be finished properly. /* Defines the error callback */ function errorCallback(response) { - console.log("The following error occurred: " + response.name); +  console.log("The following error occurred: " + response.name); } /* Defines the unregistration success callback */ function unregisterSuccessCallback() { - console.log("Unregistration succeeded."); +  console.log("Unregistration succeeded."); } /* Requests unregistration */ @@ -661,7 +647,7 @@ the registerService() method must be called before calling the conn /* Defines the connect success callback */ function notificationCallback(noti) { - console.log("Notification received with alert message: " + noti.alertMessage); +  console.log("Notification received with alert message: " + noti.alertMessage); } /* Defines the data to be used when this process is launched by notification service */ @@ -670,16 +656,16 @@ var service = new tizen.ApplicationControl("http://tizen.org/appcontrol/operatio /* Defines the error callback */ function errorCallback(response) { - console.log("The following error occurred: " + response.name); +  console.log("The following error occurred: " + response.name); } /* Defines the registration success callback */ function registerSuccessCallback(id) { - console.log("Registration succeeded with id: " + id); +  console.log("Registration succeeded with id: " + id); - /* Requests for push service connection */ - tizen.push.connectService(notificationCallback); +  /* Requests for push service connection */ +  tizen.push.connectService(notificationCallback); } /* Requests registration */ @@ -755,19 +741,19 @@ just after connection is established. /* Defines the state change callback */ function stateChangeCallback(state) { - console.log("The state is changed to: " + state); +  console.log("The state is changed to: " + state); } /* Defines the notification callback */ function notificationCallback(notification) { - console.log("A notification arrives."); +  console.log("A notification arrives."); } /* Defines the error callback */ function errorCallback(error) { - console.log("The following error occurred: " + error.name); +  console.log("The following error occurred: " + error.name); } /* Requests for push service connection */ @@ -904,7 +890,7 @@ tizen.push.disconnect(); var registrationId = tizen.push.getRegistrationId(); if (registrationId != null) { - console.log("The registration id: " + registrationId); +  console.log("The registration id: " + registrationId); }
    @@ -913,16 +899,16 @@ if (registrationId != null) /* Defines the state change callback */ function stateChangeCallback(state) { - console.log("The state is changed to: " + state); +  console.log("The state is changed to: " + state); - var id = tizen.push.getRegisterationId(); - console.log("The registration ID: " + id); +  var id = tizen.push.getRegisterationId(); +  console.log("The registration ID: " + id); } /* Defines the notification callback */ function notificationCallback(notification) { - console.log("A notification arrives."); +  console.log("A notification arrives."); } /* Requests for push service connection */ @@ -990,7 +976,7 @@ Once a missed push notification is retrieved the server deletes it from its data /* Defines the connect success callback */ function notificationCallback(message) { - console.log("New push message: " + message.alertMessage + ", date: " + message.date + ", data: " + message.appData); +  console.log("New push message: " + message.alertMessage + ", date: " + message.date + ", data: " + message.appData); } /* Requests for push service connection */ @@ -1003,19 +989,19 @@ tizen.push.getUnreadNotifications(); /* Defines the state change callback */ function stateChangeCallback(state) { - console.log("The state is changed to: " + state); +  console.log("The state is changed to: " + state); - if (state === "REGISTERED") - { - /* Gets unread push notifications */ - tizen.push.getUnreadNotifications(); - } +  if (state === "REGISTERED") +  { +    /* Gets unread push notifications */ +    tizen.push.getUnreadNotifications(); +  } } /* Defines the notification callback */ function notificationCallback(notification) { - console.log("A notification arrives."); +  console.log("A notification arrives."); } /* Requests for push service connection */ @@ -1077,12 +1063,12 @@ If the application was not launched by the push service, this method returns

    Code example:

     try
     {
    -   var message = tizen.push.getPushMessage();
    -   console.log('Message received from: ' + message.sender);
    +  var message = tizen.push.getPushMessage();
    +  console.log("Message received from: " + message.sender);
     }
     catch (err)
     {
    -   console.log('Exception - code: ' + err.name + ' message: ' + err.message);
    +  console.log("Exception - code: " + err.name + " message: " + err.message);
     }
     
    @@ -1197,24 +1183,31 @@ This data is the message that the sender wants to send and its length must be le

    Code example:

    +/* Defines the state change callback */
    +function stateChangeCallback(state)
    +{
    +  console.log("The state is changed to: " + state);
    +}
    +
     /* Defines the connect success callback */
     function notificationCallback(noti)
     {
    -   console.log('notification received on ' + noti.date + ' from: ' + noti.sender);
    -   console.log('Details:');
    -   console.log(' - data: ' + noti.appData);
    -   console.log(' - alert message: ' + noti.alertMessage);
    -   console.log(' - message: ' + noti.message);
    -   console.log(' - session: ' + noti.sessionInfo);
    -   console.log(' - request ID: ' + noti.requestId);
    +  console.log("notification received on " + noti.date + " from: " + noti.sender);
    +  console.log("Details:");
    +  console.log(" - data: " + noti.appData);
    +  console.log(" - alert message: " + noti.alertMessage);
    +  console.log(" - message: " + noti.message);
    +  console.log(" - session: " + noti.sessionInfo);
    +  console.log(" - request ID: " + noti.requestId);
     }
     
     /* Requests for push service connection */
    -tizen.push.connectService(notificationCallback);
    +tizen.push.connect(stateChangeCallback, notificationCallback);
     
    -

    Output example:

     Notification received on Thu Jan 01 2015 from: xyz.AnotherApp
    +

    Output example:

     The state is changed to: REGISTERED
    + notification received on Thu Jan 01 2015 from: xyz.AnotherApp
      Details:
       - data: {id:asdf}
       - alert message: Hi
    @@ -1397,24 +1390,14 @@ To guarantee that the push application runs on a device with the push feature, d
         Tizen implements PushManagerObject;
     
         [NoInterfaceObject] interface PushManager {
    -      void registerService(ApplicationControl appControl, PushRegisterSuccessCallback successCallback,
    -                  optional ErrorCallback? errorCallback) raises(WebAPIException);
    -
           void register(PushRegisterSuccessCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
     
    -      void unregisterService(optional SuccessCallback? successCallback,
    -                    optional ErrorCallback? errorCallback) raises(WebAPIException);
    -
           void unregister(optional SuccessCallback? successCallback,
                           optional ErrorCallback? errorCallback) raises(WebAPIException);
     
    -      void connectService(PushNotificationCallback notificationCallback) raises(WebAPIException);
    -
           void connect(PushRegistrationStateChangeCallback stateChangeCallback,
                        PushNotificationCallback notificationCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
     
    -      void disconnectService() raises(WebAPIException);
    -
           void disconnect() raises(WebAPIException);
     
           PushRegistrationId getRegistrationId() raises(WebAPIException);