简体   繁体   中英

Pushwoosh Push Notification

I am trying to use Pushwoosh plugin pushwoosh-cordova-plugin . I followed the documentation given here

I am trying to register a mobile device through my backend service. ie is by using /registerDevice API

So my question is:

1) Do we need the following piece of code? What it exactly do?

pushwoosh.onDeviceReady({
appid: "PUSHWOOSH_APP_ID",
projectid: "GOOGLE_PROJECT_NUMBER",
serviceName: "MPNS_SERVICE_NAME"
});

2) Can we only have the following piece of code and receive mobile push notification from my notification provider ie Pushwoosh ?

document.addEventListener('push-notification', function(event) {
var notification = event.notification;
// handle push open here
});

yes, you need this code to register your app and to recieve notifications from pushwoosh service. you can get all this details 1.appid from pushwoosh account 2. projectid from google api console

pushwoosh.onDeviceReady({
appid: "7BCF0-9F***",
projectid: "102568298****",
serviceName: "APPNAME"
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM