Languages

Menu
Sites
Language
Problems with push connect and registration.

Hello everyone! I need help with connect to the push server from TV app. I read all documentation about it and my Tizen push messaging service request has been approved. I get an WebApiException > 

  1. code20
  2. message"Failed to connect to push service"
  3. name"AbortError"

 

Responses

1 Replies
itv itv

I used this code.

  function errorCallback(response) {
  console.log('The following error occurred: ' + response.name);
 }

 /* Define the registration success callback */
 function registerSuccessCallback(id) {
  console.log('Registration succeeded with id: ' + id);
 }

 /* Define the state change callback */
 function stateChangeCallback(state) {
  console.log('The state is changed to: ' + state);

  if (state == 'UNREGISTERED') {
   /* Request application registration */

   tizen.push.register(registerSuccessCallback, errorCallback);
  }
 }

 /* Define the notification callback */
 function notificationCallback(notification) {
  console.log('A notification arrives.');
 }

 /*
 Define the data to be used when this process
 is launched by the notification service
*/


 try {
  tizen.push.connect(stateChangeCallback, notificationCallback, errorCallback);//TODO
 } catch (e) {
  console.log(e);
 }