react-native-background-actions icon indicating copy to clipboard operation
react-native-background-actions copied to clipboard

Fix android 14 crash with implicit intent

Open devtyty opened this issue 5 months ago • 12 comments

devtyty avatar Jan 17 '24 08:01 devtyty

Thanks for this. I have some users reporting issues on Android 14 and will use this with patch-package to get by for now

contactsimonwilson avatar Jan 26 '24 23:01 contactsimonwilson

its work for me

sssajjad007 avatar Jan 31 '24 10:01 sssajjad007

Hi, I was making the same modifications on my end when I saw your PR. I agree with the changes on the RNBackgroundActionsTask.java class. But for this, I think compileSDKVersion need to pass at least to 34 to assure have UPSIDE_DOWN_CAKE constant.

For the foreground type, an action is not always of type shortService. I try to found a way to set a dynamically foregroundService

GaelCO avatar Feb 06 '24 11:02 GaelCO

Hi, I was making the same modifications on my end when I saw your PR. I agree with the changes on the RNBackgroundActionsTask.java class. But for this, I think compileSDKVersion need to pass at least to 34 to assure have UPSIDE_DOWN_CAKE constant.

For the foreground type, an action is not always of type shortService. I try to found a way to set a dynamically foregroundService

Agreed with the service type. I'm using specialUse for my app with this patch. If using expo, this could easily be dynamic with a config plugin

contactsimonwilson avatar Feb 06 '24 11:02 contactsimonwilson

The foreground type could be pass by parameter since API Level 29. I'm going to try a solution with adding type(s) in options. /!\ Some types need permission on manifest. I consider that they should not be added to the library and that it is the responsibility of each application.

GaelCO avatar Feb 06 '24 13:02 GaelCO

The foreground type could be pass by parameter since API Level 29. I'm going to try a solution with adding type(s) in options. /!\ Some types need permission on manifest. I consider that they should not be added to the library and that it is the responsibility of each application.

Right! Thanks for your feedback, i think we should set compileSDKVersion to 34 for library and foreground type to be is the responsibility of each application.

Maybe i will update this patch

devtyty avatar Feb 06 '24 14:02 devtyty

After some test and read the document, it seems to be impossible to set the foregroundType directly in the startForeground method without declare it in the service tag (manifest). If we had all the possible tags, we must declare all the corresponding permissions. Imho, It's not an option This parameter is just useful if a service could have different type and precise when it is called.

I don't see any other solution than indicating in the documentation that the service must be redeclared in the application manifest with the correct foregroundType.

GaelCO avatar Feb 07 '24 14:02 GaelCO

After some test and read the document, it seems to be impossible de set the foregroundType directly in the startForeground method without declare it in the service tag (manifest). If we had all the possible tags, we must declare all the corresponding permissions. Imho, It's not an option This parameter is just useful if a service could have different type and precise when it is called.

I don't see any other solution than indicating in the documentation that the service must be redeclared in the application manifest with the correct foregroundType.

I updated compileSdk to 34 and remove foregroundSeviceType in lib's manifest. We should to declare in self application with permission related.

Refer

To startForeground with dynamic type, i think lib must be to chang with param is permission type corresponding

devtyty avatar Feb 19 '24 06:02 devtyty

Worked for me!

MarkNaArea avatar Mar 07 '24 16:03 MarkNaArea

Hi, is there any news with respect to this PR? Need help with anything?

marcosinigaglia avatar Apr 23 '24 07:04 marcosinigaglia

Worked for me too!

rolandvar avatar May 06 '24 21:05 rolandvar

i am going to use it now. seem working for you guys

ansarikhurshid786 avatar May 15 '24 19:05 ansarikhurshid786