NIFCLOUD-mbaas / UserCommunity

ニフクラ mobile backend ユーザーコミュニティ
https://mbaas.nifcloud.com/
81 stars 18 forks source link

NCMBInstallationのobjectIdを取得したい #1023

Closed AyakoHoriuchi closed 5 years ago

AyakoHoriuchi commented 5 years ago

以前のライブラリではNCMBInstallation#getRegistrationIdInBackground()のCallback関数内で取得できたのですが、廃止になったためどうすればいいか教えていただきたいです。

goofmint commented 5 years ago

final NCMBInstallation installation = NCMBInstallation.getCurrentInstallation();

でいけるかと思います。

https://mbaas.nifcloud.com/doc/current/push/filter_android.html

AyakoHoriuchi commented 5 years ago

インストール&初回initialize直後ですと、nullになる確率が高いです。 こちら安定して取得できる方法はないのでしょうか?

goofmint commented 5 years ago

getDeviceTokenInBackground に変わっているようです。こちらお試しください。

AyakoHoriuchi commented 5 years ago

ありがとうございました。