繁体   English   中英

如何更新parse.com中的数据浏览器频道?

[英]How to update the data browser channels in parse.com?

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

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

工作正常。 但是,如果我使用来更新到其他任何对象的通道,

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

该对象已添加到数据浏览器中的通道。

在此处输入图片说明

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

尝试:

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

替换所有现有渠道。 您当前使用的方法是显式添加到现有列表中。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM