2014-01-29 31 views
1

我使用Parse.com通過PFQuery設備之間發送推送通知如下如何更新parse.com中的數據瀏覽器頻道?

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]; 

該對象已添加到數據瀏覽器中的頻道。

enter image description here

我只是想用新的對象更新的途徑,不給加。怎麼做?什麼是PFquery更新渠道?

回答

1

嘗試:

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

替換所有現有的渠道。您當前使用的方法明確添加到現有列表中。您可以使用setObject:forKey:替換列表。

+0

工作正常,謝謝。 – NAZIK

相關問題