Raja0sama / rn-foreground-service

Foreground Service for React Native made with ❤
https://rn-foreground.vercel.app/
148 stars 70 forks source link

Notification tab is not show in Android 12 or above versions #73

Closed ksrajath7 closed 1 year ago

ksrajath7 commented 1 year ago

The notification tab is not closable on drag in Android 9 as expected.

I am able to successfully run the task in background with the same app in Android 9

The issue with respect to Android 13 is the notification tab is closable in Android 13

ksrajath7 commented 1 year ago

https://github.com/Raja0sama/rn-foreground-service/assets/27329467/bf790631-eaf3-43a3-991d-03e795549983

In Android 9 , working perfectly as expected

ksrajath7 commented 1 year ago

https://github.com/Raja0sama/rn-foreground-service/assets/27329467/3404a558-eae9-4e77-9c82-5f4d65b5ce5c

In Android 13

Raja0sama commented 1 year ago

I will investigate.

Santosl2 commented 1 year ago

This is a expected behavior...

See in https://developer.android.com/guide/components/foreground-services#user-dismiss-notification

image

SurajMohanty02 commented 1 year ago

I can't see the notification in Android 13

ksrajath7 commented 1 year ago

@SurajMohanty02 Check if the notification permission is enabled.

Alternatively i am using a package react-native-background-actions and it is working for me

SurajMohanty02 commented 1 year ago

Manage Notification was off by default. why?

FazilMuhammed commented 1 year ago

any Update ?? Please recover the issues for Android 13

ksrajath7 commented 1 year ago

@FazilMuhammed @SB2318 @SurajMohanty02 Alternatively i am using a package react-native-background-actions and it is working for me

Raja0sama commented 1 year ago

Hello Everyone, I just was able to run this on an Android with the Android 13 version. Seems like you need a new permission to show a notification, which is

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

Please try again after adding this. Furthermore, below is an example application via which I was able to run the application.

https://github.com/Raja0sama/foreground-service-example

Please feel free report back.

@ksrajath7 @FazilMuhammed @SurajMohanty02

Raja0sama commented 1 year ago

In Addition, you can use libraries like React Native Permission to request permission from the users. Permission required moving forward by user.

https://www.npmjs.com/package/react-native-permissions

Also the notification are now dismissable, but seems like the process stills is active and working.

dev-abhinavsinghHP commented 10 months ago

Hi @Raja0sama I add this Line But not getting Notification in Android Version 13 it is working fine in Android Version 11