【发布时间】:2015-06-05 08:04:35
【问题描述】:
ParseInstallation 类将 deviceToken 返回为 null,并且在 Parse.com 安装表中,安装保存为空 deviceToken。
使用
- 解析Android SDK 1.9.4
- 科尔多瓦版本:5.0.0
- com.phonegap.parsepushplugin(fork:https://github.com/taivo/parse-push-plugin)
Android 应用类 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
}
});
}
【问题讨论】:
-
在真机或模拟器上测试过?
-
用真机(三星 Galaxy Ace 4)
-
你解决了吗? @TuomasLaatikainen
-
@Rudy_TM 下面我自己的答案是我的解决方案。
标签: android cordova parse-platform push-notification