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

[NOT READY] Selective permissions #276

Closed
wants to merge 7 commits into from

Conversation

chrusart
Copy link

@chrusart chrusart commented Nov 10, 2018

Now you can create RNPPermissions.xcconfig file in ios/ folder and provide preprocessor variables e.g.:

RNP_SELECTIVE = RNP_PERMISSIONS_SELECTIVE
RNP_PERMISSION_TYPES = RNP_TYPE_LOCATION RNP_TYPE_NOTIFICATION

Only code responsible for particular permission will be compiled in and no need to include all usage descriptions in Info.plist.

By default it includes all if RNP_PERMISSIONS_SELECTIVE not given, but I think in future it should be always a list of needed permission types.

Some refactoring done as well, docs will be added if will be some response from maintainer as this repo wasn't updated for some time.

To use this implementation:

"react-native-permissions": "github:flatfox-ag/react-native-permissions#7683bceac6f152d74e98574eb90916bad3b2363b",

Any feedback welcome.

@chrusart chrusart changed the title Selective permissions [NOT READY] Selective permissions Nov 10, 2018
@chrusart
Copy link
Author

chrusart commented Nov 10, 2018

Well, it still deosn't work, something still to be done. Working on it. Or it's other library.

@chrusart
Copy link
Author

I have to abandon this pr, can't get it to work.

@chrusart chrusart closed this Nov 13, 2018
@chrusart
Copy link
Author

I just couldn't get preprocessor macros to work, for example:

with simple RNP_PERMISSION_TYPES = RNP_TYPE_LOCATION in RNPPermissions.xcconfig,
it is in Release/Debug preprocessor macros in ReactNativePermissions xcode project,

#ifdef RNP_TYPE_LOCATION
             @(RNPTypeLocation) : @"RNPLocation",
#endif

is normally highlighted in XCode as it should be compiled,
but actually is not, when dubugging, NSDictionary is empty, i'm not sure what I'm missing here, i tried few approaches.

@chrusart
Copy link
Author

If somebody will point error I will for sure finish this pr and resubmit.

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.

1 participant