获取设备令牌?

Phi*_*lip 4 android get devicetoken

我正在尝试获取设备的令牌.想到这个:

ParseInstallation parseInstallation = new ParseInstallation();
    String deviceToken = (String) parseInstallation.get("deviceToken");
Run Code Online (Sandbox Code Playgroud)

会做的伎俩,但它没有,它返回null.为什么?

Gen*_*ene 9

读这个.希望这可以帮助.

http://android-developers.blogspot.be/2011/03/identifying-app-installations.html

要么

String android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(),
                Settings.Secure.ANDROID_ID);
Run Code Online (Sandbox Code Playgroud)

要么

您可以尝试获取UUID或IMEI.

要么

如果你在Parse Developer Console上: 在此输入图像描述