Local Notification Are not working on Amazon
I have followed all the steps to create and fire notifications but it’s not displaying in notificaions neither it appears on screen
Hi @basitjawaid ,
Can you please try the following steps and check if it could resolve the issues:
- Ensure the local notification functionality is properly implemented in the app code according to Amazon’s Fire OS platform guidelines. Double-check the API calls, notification configurations, and permissions.
- Check the app’s logs for any error messages or debugging information that could point to why the notifications are not being displayed.
- Verify that the app has the necessary permissions granted to display local notifications on the Fire TV platform. This may require specific permission handling in the code.
- Test the notification functionality thoroughly on a physical Fire TV device, as there could be differences between the emulator/simulator and the actual hardware.
If you are still facing issues please feel free to contact us and share more information like logs/videos/screen capture? This will help investigate the issue effectively.
Thanks,
Avirup M.
I have tested on Amazon fire stick 4k, and also cross check the notifications code from Android TV code and it’s working fine on android TV and not on Amazon TV
I’ll share piece of code here to further tell you I using the same code for Athan+ TV
val mngr = context!!.getSystemService(Context.NOTIFICATION_SERVICE) as? NotificationManager
val pendingIntent = PendingIntent.getActivity(
context,
10011, Intent(context,MainActivity::class.java), if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_ONE_SHOT
}else {
PendingIntent.FLAG_ONE_SHOT
}
)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
var mChannel = NotificationChannel("CHANNELs","CHANNEL",NotificationManager.IMPORTANCE_HIGH)
// Configure the notification channel.
mChannel.setDescription("description")
mChannel.enableLights(true)
mChannel.setShowBadge(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
mChannel.canBubble();
}
mChannel.enableVibration(true)
mChannel.setVibrationPattern(longArrayOf(100, 200, 300, 400, 500, 400, 300, 200, 400))
mngr?.createNotificationChannel(mChannel)
mngr?.notify(10011,Notification.Builder(context,"CHANNELs")
.setContentTitle("Test")
.setSmallIcon(R.drawable.app_logo_new)
.setContentIntent(pendingIntent)
.setContentText("Test Notification Details")
.setPriority(Notification.PRIORITY_HIGH)
.build())
}else{
mngr?.notify(10011,Notification.Builder(context)
.setPriority(Notification.PRIORITY_HIGH)
.setContentTitle("Test")
.setSmallIcon(R.drawable.app_logo_new)
.setContentText("Test Notification Details")
.setContentIntent(pendingIntent)
.setVibrate( longArrayOf(
100,
200,
300,
400,
500,
400,
300,
200,
400
))
.build())
}
Also just for the info, there are no APIs involved
@avirupm I tried checking 4k fire stick notification preferences and it’s set to notifications ON.
I also tested other apps, most of the apps fire remote notifications
Is there any limitation on how notifications work in Amazon ?
Keep in mind I need local notification.
The scenario is User will set schedule alarms to remind them to get back or open the app at certain time.
I also noticed, the Broadcast receiver is working fine, it’s just not firing notification when we call
notificationManager.notify(CODE,notificationBuilder.build())
FireOS version is 8.1.1.6