【发布时间】:2014-06-09 11:54:13
【问题描述】:
我正在关注本教程:http://intown.biz/2014/04/11/android-notifications/
我正在开发一个 Node.js/Angular/PhoneGap/Ionic 应用程序,使用 node-gcm 发送通知。
但我无法理解本教程的某些部分。在代码的最后一部分,Android应用程序代码,你可以看到:
registerID : function (id) {
//Insert code here to store the user's ID on your notification server.
//You'll probably have a web service (wrapped in an Angular service of course) set up for this.
//For example:
MyService.registerNotificationID(id).then(function(response){
if (response.data.Result) {
console.info('NOTIFY Registration succeeded');
} else {
console.error('NOTIFY Registration failed');
}
});
所以我必须编写一个服务(这里称为MyService)来获取用户的ID,对吧?
问题是:我什么都不懂,我什至不确定我们在这里谈论的是哪个ID。那是安卓设备的ID吗?
【问题讨论】:
标签: android angularjs cordova push-notification ionic-framework