Android のプッシュ通知を送信するには何が必要ですか (iOS のように、単純なプッシュを送信するにはデバイスの udid が必要です)?
デバイスの登録 ID を取得する必要がある場合、どうすれば取得できますか?
ありがとうございました。
Android のプッシュ通知を送信するには何が必要ですか (iOS のように、単純なプッシュを送信するにはデバイスの udid が必要です)?
デバイスの登録 ID を取得する必要がある場合、どうすれば取得できますか?
ありがとうございました。
これが必要ですか?
public static String getDeviceID(Context context) {
final TelephonyManager tm = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
final String tmDevice, tmSerial, tmPhone, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "";// + tm.getSimSerialNumber();
androidId = ""
+ android.provider.Settings.Secure.getString(
context.getContentResolver(),
android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(),
((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
String deviceId = deviceUuid.toString();
return deviceId;
}