[英]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.