我想使用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 這,如果你想發送推送通知所有下載應用程序的設備 –