ParseInstallation class returns deviceToken as null and also in Parse.com Installation table the installation is saved as empty deviceToken.
Using
- Parse Android SDK 1.9.4
- Cordova version: 5.0.0
- com.phonegap.parsepushplugin (fork: https://github.com/taivo/parse-push-plugin)
Android application class onCreate:
@Override
public void onCreate() {
super.onCreate();
ParseCrashReporting.enable(getApplicationContext());
Parse.initialize(this, "xx", "xx");
ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
String deviceToken = (String) ParseInstallation.getCurrentInstallation().get("deviceToken");
Log.d("my_app","DEVICE TOKEN: " + deviceToken); // --> returns null string
}
});
}
Found the error. I had to change Parse permissions (allow adding fields) on Installation class and after that 'channels' field shown up and also deviceToken was saved.
Update:
You can confirm this on the app settings: Core > Data > _Installation > Security (button on toolbar)
By default it has access to create new fields but I had changed it.