我正在使用ionic来开发一个应用程序,我需要获取推送通知的设备令牌,但是遇到了麻烦.应用程序没有收到通知,但我仍然需要在用户登录应用程序时发送设备令牌(例如,我需要获取设备令
var push = PushNotification.init({
"android": {
"senderID": "SENDER-ID"
},
"ios": {"alert": "true", "badge": "true", "sound": "true"},
"windows": {}
});
push.on('registration', function(data) {
console.log("registration event");
//here is your registration id
console.log(data.registrationId);
});
This也是教程的链接
希望能帮助到你.
