Normal Notification Builder doesn't show notifications on Android O.
How could I show notification on Android 8 Oreo?
Is there any new piece of code to add for showing notification on Android O?
Normal Notification Builder doesn't show notifications on Android O.
How could I show notification on Android 8 Oreo?
Is there any new piece of code to add for showing notification on Android O?
Here i post some quick solution function with intent handling
This is bug in firebase api version 11.8.0, So if you reduce API version you will not face this issue.
Try this Code :
In android Oreo,notification app is done by using channels and NotificationHelper class.It should have a channel id and channel name.
First u have to create a NotificationHelper Class
public class NotificationHelper extends ContextWrapper {
}
Create a button in activity xml file,then In the main activity
protected void onCreate(Bundle savedInstanceState) {
Then run ur project
Android Notification Demo App for Android O as well as lower API versions. Here is best demo app on GitHub-Demo 1 and GitHub-Demo 2.
In Android O it's a must to use a channel with your Notification Builder
below is a sample code :
Or with Handling compatibility by:
or if you want a simple fix then use the following code:
Updates: NotificationCompat.Builder reference
This constructor was deprecated in API level 26.0.0 so you should use
so no need to
setChannelId
with the new constructor.And you should use the latest of AppCompat library currently 26.0.2
Source from Android Developers Channel on Youtube
Also, you could check official Android Docs