phonegap-parse-plugin
phonegap-parse-plugin copied to clipboard
getInstallationObjectId - Asynchronicity issue - Help & Idea
Hey, I was trying to get my Installation Object Id using the method getInstallationObjectId but I am having some problems. If I run it as soon as the app runs it returns null, but what is strange is that the method getInstallationId returns the expected value just right after the app opens without problems. I need the object id in order to make an update in the object and a few more attributes to the installation, like for example the user.
Can someone please help me find the solution?
PD: It would be really cool to have a method call "addAtributeToInstallation" (or something similar) and that given the name of the attribute and the attribute values, it stores it without having to make any HTTP request outside the plugin.
Something like this: window.parsePlugin.addAtributeToInstallation("color, "blue");
Thanks you all very much! Hope someone can help me :)
Workaround for that issue
var objectIdInterval = setInterval(function() {
parsePlugin.getInstallationObjectId(function(id) {
if (id != null) {
console.log(id);
clearInterval(objectIdInterval);
onIdReceivedFunction(id);
}
});
}, 200);
I have the same problem. getInstallationObjectId() always returns null while getInstallationId() works fine. Am i just missing something?