Android Emulator Not Receiving Push Notifications

Android emulator not receiving push notifications

Which target have your emulator? For Google Services like GCM, use a "Google APIs" (any version) target to receive push notifications

Notification shows up in android emulator but not on physical device

I found that, If the phone is in power saver mode or any battery optimized mode the notifications won't show up. Turning off power saver mode worked for me.

Notifications are working on an emulator but not on a real device

in Android 8.0 required Channal

you need to add this

 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
CharSequence name = getString(R.string.app_name);
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name, importance);
assert notificationManager != null;
notificationManager.createNotificationChannel(mChannel);
}

and

String CHANNEL_ID = "my_channel_01";
notificationBuilder.setChannelId(CHANNEL_ID);


Related Topics



Leave a reply



Submit