Languages

Menu
Sites
Language
Push registration problem.
Hello,
I have a question about push registration.
 

I added the privilege h t t p : / / tizen.org/privilege/push and

I wrote the code like following

 

var service = new tizen.ApplicationControl("h t t p : / / tizen.org/appcontrol/operation/push_test");
tizen.push.registerService(service, registerPushSuccessCallback, errorPushCallback);
 
function errorPushCallback(response)
{ }
 
/* Define the registration success callback */
function registerPushSuccessCallback(id)
{ }
 
But, I've got the exception like below
"UnknownError: Platform error while registering the application. : Invalid parameter"
 
It worked well untill a few days ago.
 
Thanks.
 
 
Edited by: Gunwoo Lee on 27 Mar, 2017

Responses

2 Replies
Armaan-Ul- Islam

Up to Tizen 2.4 Registration to push service Sample Code:

var service = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/push_test");

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

function registerSuccessCallback(id)
{
   console.log("Registration succeeded with id: " + id);
}

tizen.push.registerService(service, registerSuccessCallback, errorCallback);

 

And with the change of platform to Tizen 3.0 the Sample code above would generate Platform error. Since Tizen 3.0 Registration to push service Sample Code would be like:

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

function registerSuccessCallback(id)
{
   console.log("Registration succeeded with id: " + id);
}

function stateChangeCallback(state)
{
   console.log("The state is changed to: " + state);

   if (state == "UNREGISTERED")
   {
      tizen.push.register(registerSuccessCallback, errorCallback);
   }
}

function notificationCallback(notification)
{
   console.log("A notification arrives.");
}

tizen.push.connect(stateChangeCallback, notificationCallback, errorCallback);

 

I guess that could be the reason of "Platform error while registering the application. : Invalid parameter"

Please check this Link for details.

https://developer.tizen.org/development/guides/web-application/messaging/push-notification#Registering

Gunwoo Lee

Thanks but I found another reason of that.
I've found that '2.3' was written at 'required_version' in config.xml.
If I write above 2.3 then it works well.
It seems that 'tizen.push.registerService' is working only from 2.3.1 to 2.4. (Not 2.3, 2.2, ...) (on wearable devices)

 

Thanks.