Languages

Menu
Sites
Language
[Web Wearable] Sending push notifications in testing environment

Is it possible to receive push notifications in a testing environment?

I can register to the push notification server just fine, but i am unable to receive notifications. I've tested it on a real device and an emulator.

Thanks in advance!

Edited by: Jamie Knoef on 03 Jul, 2017

Responses

6 Replies
André Reus

hi Jamie Knoef

I didn't get what are you meaning by 'testing environment'. 
Did you try with Tizen push_test Server?

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

And as far as i know, developers need to request for Tizen Push Service. You can request here => https://developer.tizen.org/webform/request-permission-tizen-push-service

Also see this => https://developer.tizen.org/development/api-references/web-application?redirect=/dev-guide/2.4/org.tizen.web.apireference/html/device_api/mobile/tizen/push.html#PushRegistrationId

Jamie Knoef

Hi Andre,

By testing environment I ment my local machine running an emulator to run my development app.

The thing is, I'm not receiving any push notifications. I've tested this on my emulator and on an actual wearable device. (Do note that the app I installed was done by Tizen Studio, so it's a development app, not installed from the store). Do push notifications only work once the app is downloaded from the store, or should it also work when the app isn't installed from the store?

I can send push notifications just fine:

"regID": "--",
"requestID": "0000001",
"statusCode": 1000,
"statusMsg": "Success"
Jamie Knoef
function initialize() {
    var service = new tizen.ApplicationControl('http://tizen.org/appcontrol/operation/push_test');

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

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

function notificationCallback(message) {
    console.log('New push message: ' + message.alertMessage + ', date: ' + message.date + ', data: ' + message.appData);
}

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

    tizen.push.connectService(notificationCallback, errorCallback);
    console.log(tizen.push.getUnreadNotifications());
}

 

The service registration seems to be working, because it prints a registration id.

 

André Reus

 Did you Request for Push Notification service with link provided above?  I think that is mandatory! 

Jamie Knoef

Yes I did. I received an app id & key.

André Reus

What did you find from notificationCallback?

And may be you have not sent any push message to the push server. Please let me know.