2016-01-04 33 views
0

我正在使用安裝進行推送通知。解析安裝deleteInBackground()

我想使用func刪除安裝上的所有通道,而不使用removeObject,因爲這時應用程序會在線時出錯,因爲它將在不保存背景的情況下存儲addUniqueobject和removeObject。我試過使用。

let currentInstallation = PFInstallation.currentInstallation() 
       currentInstallation.deleteInBackground() 

但它不會從安裝中刪除通道。有誰知道如何從解析安裝中刪除所有通道?

回答

0

您應該刪除當前安裝通道屬性中的通道,然後保存安裝對象。

我不記得了屬性的名稱完全相同,但它可能是這樣的:

PFInstallation.currentInstallation.channels = [""] 
PFInstallation.currentInstallation.saveInBackground() 
+0

感謝,它幫助了很多,但你不能使用零。它與[「」] – tarjerw

+0

很好,我已經更新了我的答案。 –