簡體   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