Raja0sama/rn-foreground-service

Notification message and title not showing. It is showing default notification

Closed this issue · 6 comments

The task is running perfectly.
But notification is not showing as I expect it to be.

I always shows this default notification.
Default title - {{app name}} is running
Default message - Tap for more information or to stop the app.

I have put this code.
ReactNativeForegroundService.start({ id: 144, title: 'Foreground Service', message: 'you are online!', });

I am using android 12.
I am following this example.
https://github.com/Raja0sama/ForegroundSerivceExample

@melroyvinpinto, I am facing the same issue please let me know if you find any solution. Thanks :)

Notification might take some time to appear and mostly when you minimize the app, it appears.

The New version is out check if that can be any help to you.

@Raja0sama I'm facing the exactly same issue.

Could you help us, please??

It always shows the message below and doesn't get the app icon

WhatsApp Image 2023-01-02 at 3 34 50 PM

Fixed Bois, ✅

PR :
#48

New Version Released:

yarn add @supersami/rn-foreground-service@2.0.2

To override the icon, please add an image asset into your android project via android studio, and then you can reference that assets like this

 ReactNativeForegroundService.start({
            id: 144,
            title: 'Foreground Service',
            message: 'you are online!',
            importance: '2',
            icon: 'ic_launcher_foreground',
          });

@matheusyuri7 @vaibhav-addressya @melroyvinpinto

Thank you so much @Raja0sama !! you are the best!

You just saved my day

I wish you a wonderful 2023