2016-06-30 5 views
0

何かを言う前に - はい、私はパースが閉じていることを知っています:)しかし、私は本当にこれが必要です。チャンネルを購読しない - Swiftを解析する

チャンネルに登録しようとしています(documented in Parseのように)。 しかし、コア画面に追加したチャンネルは表示されません。バージョンが正しいと確信しています。ここで

enter image description here

私のコードです:

let currentInstallation = PFInstallation.currentInstallation() 
    currentInstallation.addUniqueObject("myChannel", forKey: "channels") 
    currentInstallation.saveInBackground() 

私はこのような配列に"myChannel"を追加してみました:私は間違って

let currentInstallation = PFInstallation.currentInstallation() 
    currentInstallation.addUniqueObject(["myChannel"], forKey: "channels") 
    currentInstallation.saveInBackground() 

何をしているのですか?

編集:ブロック内

let currentInstallation = PFInstallation.currentInstallation() 
    currentInstallation.addUniqueObject("beybey", forKey: "channels") 
    currentInstallation.saveInBackgroundWithBlock { (bool: Bool, error: NSError?) in 
     print(bool) 
     print(error) 
    } 

ブレークポイントがトリガされなかった。sujjested Shubank として、私は次の試み。

+0

を作成され、そのインスタンスまでアクセスするリモート通知のために登録されるのを待つのか?エラー/結果コールバックを 'saveInBackground'メソッド – Shubhank

+0

@ Shubhankに渡すこともできます。コードは呼び出されています。どのようにエラー/結果を渡すのですか? – Luda

+0

https://www.parse.com/docs/osx/api/Categories/PFObject(Deprecated).html#/c:objc(cs)PFObject(im)saveInBackgroundWithTarget:selector: – Shubhank

答えて

0

現在のインストールは、アクセスしている場所ではnilです。

おそらくトークンは関数が呼び出されている

関連する問題