Parse platform 仅使用deviceToken解析推送

Parse platform 仅使用deviceToken解析推送,parse-platform,push-notification,apple-push-notifications,Parse Platform,Push Notification,Apple Push Notifications,发送推送通知的最少步骤数是多少?我已经通过iOS本机访问了deviceToken,是否必须通过解析创建安装对象?我宁愿现在不更改任何本机代码。我可以做下面这样的事情吗?或者在此步骤之前是否需要创建安装对象?下面使用的是一个节点库。。但是想象一下它正在使用REST端点 var notification = { where : { "deviceToken": { "$in": ["deviceTokenHere"] } }, data: {

发送推送通知的最少步骤数是多少?我已经通过iOS本机访问了deviceToken,是否必须通过解析创建安装对象?我宁愿现在不更改任何本机代码。我可以做下面这样的事情吗?或者在此步骤之前是否需要创建安装对象?下面使用的是一个节点库。。但是想象一下它正在使用REST端点

var notification = {
  where : {
     "deviceToken": { 
        "$in": ["deviceTokenHere"] 
      }
  },
  data: {
    alert: "eat drink and be merry"
  }
};
this.client.sendPush(notification, function(err, resp){

});

是的,您需要一个安装对象。后端端的实现查询Installations集合,您无法更改此设置

添加代码是为了创建安装和存储令牌非常简单,不需要太多代码:

- (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    PFInstallation *installation = [PFInstallation currentInstallation];
    [installation setDeviceTokenFromData:deviceToken];
    [installation saveInBackground];
}
如果您当前将已收到的deviceToken存储在服务器上,还可以通过创建安装