我正在尝试获取我设备的令牌。想到了这个:
ParseInstallation parseInstallation = new ParseInstallation();
String deviceToken = (String) parseInstallation.get("deviceToken");
会做的伎俩,但它没有,它返回null。为什么?
我正在尝试获取我设备的令牌。想到了这个:
ParseInstallation parseInstallation = new ParseInstallation();
String deviceToken = (String) parseInstallation.get("deviceToken");
会做的伎俩,但它没有,它返回null。为什么?
读这个。希望这可以帮助。
http://android-developers.blogspot.be/2011/03/identifying-app-installations.html
或者
String android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
或者
您可以尝试获取 UUID 或 IMEI。
或者
如果您在 Parse Developer Console 上:
Android 设备不存在稳定的唯一 ID。您也许可以使用ANDROID_ID,但它会在操作系统升级/系统重置时发生变化
我正在使用此代码,它对我有用! 但是解析控制台中的某些设备未定义设备令牌(我不知道为什么!)
String token = (String) ParseInstallation.getCurrentInstallation().get("deviceToken");