Help me figure out how to get a device token that I can use for a long time on the server side.

1 answer 1

If you need a unique device ID that is guaranteed not to change over time, use Secure.ANDROID_ID

private String android_id = Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID);