ios - 如何更新 parse.com 中的数据浏览器 channel ?

标签 ios iphone push-notification parse-platform

我正在使用 Parse.com通过 PFQuery 在设备之间发送推送通知,如下所示

PFPush *push = [[PFPush alloc] init];
[push setChannel:[NSString stringWithFormat:@"User%@",id];
[push setMessage:@"You have a new message"];
[push sendPushInBackground];

它工作正常。但是,如果我使用以下方法将 channel 更新为任何其他对象,

PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation addUniqueObject:@"Giants1" forKey:@"channels"];
[currentInstallation saveInBackground];

对象已添加到数据浏览器的 channel 中。

enter image description here

我只想用新对象更新 channel ,而不是添加。怎么做?更新 channel 的 PFquery 是什么?

最佳答案

尝试:

currentInstallation.channels = @[ @"Giants1" ];

替换所有现有 channel 。您当前使用的方法正在明确添加到现有列表中。

您还应该能够使用 setObject:forKey: 来替换列表。

关于ios - 如何更新 parse.com 中的数据浏览器 channel ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21428810/

相关文章:

ios - 从 WebView 检测 UIImagePicker 打开与否

iphone - UIGestureRecognizers 的多种手势(iPhone、Cocos2d)

ios - 在 Adhoc 构建的情况下推送通知过期持续时间

java - 前台服务,警报管理器,通知现在显示

Xcode、Parse - 处理远程通知

ios - 拖动 UIButton 而不将其移动到中心 [Swift 3]

ios - 将 UITableView 约束到其父 View 的边缘会导致布局冲突

ios - 使用 NSScanner 转换 NSString

javascript - 在 JavaScript 中,是否有针对 iPhone 浏览器的开始滚动事件?

iOs - 无法识别的选择器发送到 TextAction 上的实例