[英]Query on local datastore with unsaved pinned object of id null in Parse SDK Android
[英]Object ID and Installation ID in parse SDK giving null value
我正在嘗試通過使用以下代碼從解析中獲取installation id
和object id
:
Parse.initialize(this, Constants.PARSE_APPLICATION_ID, Constants.PARSE_CLIENT_KEY);
ParseInstallation.getCurrentInstallation().getObjectId() and
ParseInstallation.getCurrentInstallation().getInstallationId().
我在android的應用程序類中使用以上代碼。 都給我空。 有時它們會為我提供值,但不會在解析控制台中顯示其條目。 誰能幫我這個忙,我到底在做什么錯。 提前致謝。
首先,您訂閱解析推送,然后更新安裝表中的記錄。
ParsePush.subscribeInBackground( “APP_NAME”);
訂閱后,請致電Installation以獲取objectId和installationId。
您的代碼是這樣的:
在您的應用程序類中
Parse.initialize(this, Constants.PARSE_APPLICATION_ID, Constants.PARSE_CLIENT_KEY);
ParsePush.subscribeInBackground("APP_NAME");
在您要獲取此ID的Activity中: ParseInstallation.getCurrentInstallation().getObjectId() and ParseInstallation.getCurrentInstallation().getInstallationId()
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.