Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Notification custom implementation #21

Closed
hemant-mobmaxime opened this issue Jan 28, 2022 · 1 comment
Closed

Android Notification custom implementation #21

hemant-mobmaxime opened this issue Jan 28, 2022 · 1 comment

Comments

@hemant-mobmaxime
Copy link

First of the all, the library is great. Helps me to implement most of the firebase functionality in my app.

My only concern is when I send multiple notification in android, it's shows multiple notifications in notification bar & history. Is there a way that I can extend/exclude the service & create my notification customisation?

Or it would be a better to add grouping of the notification when multiple notification appears just like gmail handles it.

@TobiasBuchholz
Copy link
Owner

Hi, thanks and sorry for the late response. The android FirebaseCloudMessagingImplementation class contains a static property NotificationBuilderProvider, which is a function that lets you create a custom notification builder which should serve your needs.

...
FirebaseCloudMessagingImplementation.NotificationBuilderProvider = CreateCustomNotificationBuilder;
...

private NotificationCompat.Builder CreateCustomNotificationBuilder(FCMNotification notification)
{
    return new NotificationCompat.Builder(this, FirebaseCloudMessagingImplementation.ChannelId)
        .SetSmallIcon(Android.Resource.Drawable.SymDefAppIcon)
        .SetContentTitle("Custom notification")
        .SetContentText(notification.Body);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants