Android notifications not showing in tray after API 26 upgrade


#1

Hello! I compiled my app for Android with API 27 and noticed that notifications are not coming to the tray anymore. API’s older than that work ok. The payload from the notification comes to the app, so the notification itself works, but doesn’t show up in the tray. I then read this from android.com: “Starting in Android 8.0 (API level 26), all notifications must be assigned to a channel or it will not appear.”

How can I assign a channel in the payload/app to make the notification appear in the tray?


#2

In Impl.uno I added (before notificationManager.notify):

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {

	String channelId = "app_channel_id";
	CharSequence channelName = "app_channel_name";
	int importance = android.app.NotificationManager.IMPORTANCE_DEFAULT;
	android.app.NotificationChannel notificationChannel = new android.app.NotificationChannel(channelId, channelName, importance);
	notificationManager.createNotificationChannel(notificationChannel);

}

But still the notification doesn’t appear in the tray. Any ideas?


#3

try with IMPORTANCE_HIGH, by the way here’s the FCM update (Fuse 1.10): https://github.com/fuse-open/fuselibs/pull/1220