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

Support for SDK 34 #347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support for SDK 34 #347

wants to merge 1 commit into from

Conversation

anindya2791
Copy link

@anindya2791 anindya2791 commented Mar 12, 2024

This should solve #343
Thanks @sandeep14

Summary

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS ✅❌
Android ✅❌

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)
  • I've added Detox End-to-End Test(s)
  • I've created a snack to demonstrate the changes: LINK HERE

uspython added a commit to uspython/react-native-background-upload that referenced this pull request Mar 29, 2024
@mtshv
Copy link

mtshv commented Jul 2, 2024

hey @anindya2791 I've implemented your changes and it indeed builds and works as expected. Thanks for your work (cc @sandeep14)

However, I have issues with uploading my APK to the google play store due to

"message": "You must let us know whether your app uses any Foreground Service permissions.",
"status": "PERMISSION_DENIED"

I think it might be related to the net.gotev:uploadservice-okhttp version bump: https://github.com/Vydia/react-native-background-upload/pull/347/files#diff-197b190e4a3512994d2cebed8aff5479ff88e136b8cc7a4b148ec9c3945bd65aR67

See this issue: gotev/android-upload-service#660


If you guys have the same issue, or any ideas, how to solve it, please let me know.

@anindya2791
Copy link
Author

anindya2791 commented Jul 16, 2024

hey @anindya2791 I've implemented your changes and it indeed builds and works as expected. Thanks for your work (cc @sandeep14)

However, I have issues with uploading my APK to the google play store due to

"message": "You must let us know whether your app uses any Foreground Service permissions.",
"status": "PERMISSION_DENIED"

I think it might be related to the net.gotev:uploadservice-okhttp version bump: https://github.com/Vydia/react-native-background-upload/pull/347/files#diff-197b190e4a3512994d2cebed8aff5479ff88e136b8cc7a4b148ec9c3945bd65aR67

See this issue: gotev/android-upload-service#660

If you guys have the same issue, or any ideas, how to solve it, please let me know.

I think you need to declare the uses-permission in your AndroidManifest.xml

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

afaik, this is a play store mandate for Android 13+

@anindya2791
Copy link
Author

We are using this in RN 0.72.7 with SDK <= 34 so far no issues reported by users. Can we get this merged?

zatteo added a commit to cozy/cozy-flagship-app that referenced this pull request Jul 18, 2024
react-native-background-upload is not maintained. We already had a
patch for react-native 0.72, but we are getting an error when
uploading a file when targeting Android 34 : "One of
RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a
receiver isn't being registered exclusively for system broadcasts".

Fix is done in android-upload-service
gotev/android-upload-service#642

New patch is taken from
Vydia/react-native-background-upload#347
zatteo added a commit to cozy/cozy-flagship-app that referenced this pull request Jul 18, 2024
react-native-background-upload is not maintained. We already had a
patch for react-native 0.72, but we are getting an error when
uploading a file when targeting Android 34 : "One of
RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a
receiver isn't being registered exclusively for system broadcasts".

Fix is done in android-upload-service
gotev/android-upload-service#642

New patch is taken from
Vydia/react-native-background-upload#347
@kevinmartin33
Copy link

To solve the FOREGROUND_SERVICE_DATA_SYNC error on the playstore
I have use the work of tomit87 he moved service to worker
And I applied to this library

react-native-background-upload+6.6.0.patch

@mtshv
Copy link

mtshv commented Jul 22, 2024

@kevinmartin33 thank you so much for sharing your solution for this problem!
Will try your suggested approach <3


@anindya2791 thank you for the response, unfortunately explicitly declaring android.permission.FOREGROUND_SERVICE nor android.permission.FOREGROUND_SERVICE_DATA_SYNC did not resolve the issue.

both permission declarations still result in:

"message": "You must let us know whether your app uses any Foreground Service permissions.",
"status": "PERMISSION_DENIED"

@Abdelsattar
Copy link

hey @mtshv did you solve PERMISSION_DENIED problem ? and how ?

@NicTorgersen
Copy link

NicTorgersen commented Aug 26, 2024

@Abdelsattar @mtshv
Read here: expo/expo#26846 (comment)

@mtshv
Copy link

mtshv commented Sep 19, 2024

hey @Abdelsattar
In the end I provided the reasoning for the foreground permission usage to google reviewers as well as video showcasing the upload functionality. It worked. Looks like this was 1-time thing.

I crafted my explantion text based on this comment: gotev/android-upload-service#660 (comment)

Good luck!

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

Successfully merging this pull request may close these issues.

5 participants