-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Add JS library for requesting Android M Permissions #9292
Conversation
By analyzing the blame information on this pull request, we identified @caabernathy and @lacker to be potential reviewers. |
Great job, it sounds good! Can you add screenshots of the documentation ?
|
Would be awesome if you could send a follow-up PR changing callbacks to promises. |
@satya164 will do! |
@cmcewen updated the pull request. |
@@ -98,6 +98,7 @@ const ReactNative = { | |||
get NavigationExperimental() { return require('NavigationExperimental'); }, | |||
get NetInfo() { return require('NetInfo'); }, | |||
get PanResponder() { return require('PanResponder'); }, | |||
get PermissionsAndroid() { return require('PermissionsAndroid')}, | |||
get PixelRatio() { return require('PixelRatio'); }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
semi: Missing semicolon.
@cmcewen updated the pull request. |
Nice work @cmcewen! Stoked to see this one land. |
@cmcewen updated the pull request. |
1 similar comment
@cmcewen updated the pull request. |
Seems good to me, but I'd like @andreicoman11 to look at it since he wrote the permissions module piece. |
@facebook-github-bot shipit |
Thanks for importing.If you are an FB employee go to Phabricator to review internal test results. |
0fb2ccf
Summary: Explain the **motivation** for making this change. What existing problem does the pull request solve? The Android permissions native module was open sourced recently (facebook@b7352b4) but it is currently undocumented and requires directly interfacing with the native module. This provides a JS wrapper to make it easier to use the permissions module and documents it. This could be cleaner if the native code used Promise blocks instead of callbacks, but I didn't want to change the native code without a thumbs up since I'm guessing this is used in one of facebook's apps. Happy to do that if it makes sense I also tried to make the `PERMISSIONS` object a class property - it works in the actual code but not in the documentation (think it's a jsdocs problem), so decided to initialize in the constructor. **Test plan (required)** If the API looks good, I will change the UIExplorer example to use this. cc andreicoman11 Closes facebook#9292 Differential Revision: D3716303 Pulled By: andreicoman11 fbshipit-source-id: cd40b8757fdf70ea8faecfb58caa00e99a99789e
Summary: Explain the **motivation** for making this change. What existing problem does the pull request solve? The Android permissions native module was open sourced recently (facebook/react-native@b7352b4) but it is currently undocumented and requires directly interfacing with the native module. This provides a JS wrapper to make it easier to use the permissions module and documents it. This could be cleaner if the native code used Promise blocks instead of callbacks, but I didn't want to change the native code without a thumbs up since I'm guessing this is used in one of facebook's apps. Happy to do that if it makes sense I also tried to make the `PERMISSIONS` object a class property - it works in the actual code but not in the documentation (think it's a jsdocs problem), so decided to initialize in the constructor. **Test plan (required)** If the API looks good, I will change the UIExplorer example to use this. cc andreicoman11 Closes facebook/react-native#9292 Differential Revision: D3716303 Pulled By: andreicoman11 fbshipit-source-id: cd40b8757fdf70ea8faecfb58caa00e99a99789e
is this available in RN 0.37? |
Explain the motivation for making this change. What existing problem does the pull request solve?
The Android permissions native module was open sourced recently (b7352b4) but it is currently undocumented and requires directly interfacing with the native module.
This provides a JS wrapper to make it easier to use the permissions module and documents it.
This could be cleaner if the native code used Promise blocks instead of callbacks, but I didn't want to change the native code without a thumbs up since I'm guessing this is used in one of facebook's apps. Happy to do that if it makes sense
I also tried to make the
PERMISSIONS
object a class property - it works in the actual code but not in the documentation (think it's a jsdocs problem), so decided to initialize in the constructor.Test plan (required)
If the API looks good, I will change the UIExplorer example to use this.
cc @andreicoman11