我想使用FCM在离子应用中发送通知,但首先我想使用FCM获取设备标记。我已经尝试了下面的方法来获取设备token.working。但我想使用FCM获取设备令牌。任何人都知道如何获得,请帮助。使用FCM在离子中获取设备Tocken
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
var push = new Ionic.Push({
"debug": true
});
push.register(function(token) {
console.log("My Device token:",token.token);
push.saveToken(token); // persist the token in the Ionic Platform
});
});
})
嗯,你可能看着很旧的文件。检查了这一点http://stackoverflow.com/questions/37653251/firebase-cloud-messaging-with-ionic-app/39262282#39262282 这,如果你想发送推送通知所有下载应用程序的设备 –