发送推送通知必须采取的最低步骤是多少?我已经通过iOS获得了本机的iOS,是否必须通过Parse创建一个安装对象?我现在不想更改任何本机代码。我能做下面这样的事吗?还是在此步骤之前需要创建安装对象?下面使用的是一个节点库。但想象一下,它使用的是REST端点。
var notification = {
where : {
"deviceToken": {
"$in": ["deviceTokenHere"]
}
},
data: {
alert: "eat drink and be merry"
}
};
this.client.sendPush(notification, function(err, resp){
});发布于 2015-05-01 14:25:20
是的,你需要一个安装对象。后端的实现查询安装集合,您不能更改这一点。
添加代码是为了创建安装并存储令牌,这是非常直接的,不需要太多代码:
- (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
PFInstallation *installation = [PFInstallation currentInstallation];
[installation setDeviceTokenFromData:deviceToken];
[installation saveInBackground];
}如果当前将已经收到的deviceToken存储在服务器上,还可以通过REST-API创建安装。
https://stackoverflow.com/questions/29951154
复制相似问题