我找到了这个解决方案,我认为这不是通知所需的ID,请通过一些示例告诉我:
import android.provider.Settings.Secure;
private String androidIdd = Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID);
Run Code Online (Sandbox Code Playgroud)
我想我不需要一个Android id.我只想获取Firebase Notification或GCM的设备唯一ID.
android firebase firebase-cloud-messaging firebase-notifications
喜欢这个从片段到活动的良好运作.
Intent intent = new Intent(Location.this,MessageActivity.class);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)