Ios 使用解析将消息发送给登录用户
我已经在parse.com上创建了一个数据库 我想向登录用户发送推送通知 我已经创建了“安装”类。 在该类中,我添加了两个带有设备令牌的设备。 登录应用程序后,我用loginId添加了字段“owner” 之后,我试图发送推送通知,以登录使用从我的设备,但我的代码不工作 这是发送按钮的代码Ios 使用解析将消息发送给登录用户,ios,parse-platform,push-notification,Ios,Parse Platform,Push Notification,我已经在parse.com上创建了一个数据库 我想向登录用户发送推送通知 我已经创建了“安装”类。 在该类中,我添加了两个带有设备令牌的设备。 登录应用程序后,我用loginId添加了字段“owner” 之后,我试图发送推送通知,以登录使用从我的设备,但我的代码不工作 这是发送按钮的代码 - (IBAction)WRMethodBtnSendMsg:(id)sender { // Send a notification to all devices subscribed to the "Gi
- (IBAction)WRMethodBtnSendMsg:(id)sender {
// Send a notification to all devices subscribed to the "Giants" channel.
PFQuery *tmpQuery = [PFInstallation query];
[tmpQuery whereKey:@"owner" containsString:[self.sdPFObject objectId]];
PFPush *push = [[PFPush alloc] init];
[push setQuery:tmpQuery];
[push setMessage:self.wrTxtMsg.text];
[push sendPushInBackground];
}
但是推送通知不会发送
感谢您的帮助我会使用频道。让每个用户订阅一个“用户频道”,类似于这里的
user\u*user\u id.*
。然后,当您想向ID为123456的用户发送推送通知时,只需将其发送到用户\u 123456
频道。您是否创建了推送证书并将其上载到Parse.com?您是否提示用户接收推送通知?@picciano我已检查了所有使用通道属性的设备的推送通知,它运行良好