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

[question] Better understanding of what setup-ios-permissions is doing #774

Closed
raid5 opened this issue May 23, 2023 · 2 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@raid5
Copy link

raid5 commented May 23, 2023

Why it is needed?

This is more of a question and not a feature request, but I didn't see that option as one of the issue templates. For iOS, I understand that setup-ios-permissions will add the necessary source files to the RNPermissions.podspec by reading the permissions listed in the package.json (or reactNativePermissionsIOS.json). I'm curious why this is necessary and why you can't just always include all of the source files without this step? I'm trying to understand the reasoning for the added setup complexity and the pros/cons of doing it this way.

Thanks!

Possible implementation

No response

Code sample

No response

@raid5 raid5 added the feature request New feature or request label May 23, 2023
@zoontek zoontek added question Further information is requested and removed feature request New feature or request labels May 23, 2023
@zoontek
Copy link
Owner

zoontek commented May 23, 2023

On iOS, app store reviewers often reject apps that include code to request unused permissions:

The approach has been to create a modular package, at first with subspecs, then with a dedicated podspec for each permission. Each "permission handler" includes the check / request code.

It wasn't perfect since it could create a bunch of caching issues, introduce the need for a workaround when using use_frameworks!

To solve this, we switched to a react native CLI command: setup-ios-permissions
It does a pretty simple job: it edits node_modules/react-native-permissions/RNPermissions.podspec source_files to add your selected permission handlers directories.

Another benefits is that permissions handlers are now included in the module pod, not in separated ones:

I hope this answer your question.

@zoontek zoontek closed this as completed May 23, 2023
@raid5
Copy link
Author

raid5 commented May 23, 2023

@zoontek thanks for the detailed explanation! I really appreciate it and love this library <3

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

No branches or pull requests

2 participants