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

Add JS library for requesting Android M Permissions #9292

Closed
wants to merge 4 commits into from

Conversation

cmcewen
Copy link
Contributor

@cmcewen cmcewen commented Aug 8, 2016

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

@ghost
Copy link

ghost commented Aug 8, 2016

By analyzing the blame information on this pull request, we identified @caabernathy and @lacker to be potential reviewers.

@ghost ghost added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Aug 8, 2016
@charpeni
Copy link
Contributor

charpeni commented Aug 8, 2016

Great job, it sounds good!

Can you add screenshots of the documentation ?

$ cd website
$ npm install && npm start
go to: http://localhost:8079/react-native/index.html

@satya164
Copy link
Contributor

satya164 commented Aug 9, 2016

Would be awesome if you could send a follow-up PR changing callbacks to promises.

@cmcewen
Copy link
Contributor Author

cmcewen commented Aug 9, 2016

screen shot 2016-08-09 at 10 39 53 am

@satya164 will do!

@ghost
Copy link

ghost commented Aug 9, 2016

@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'); },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semi: Missing semicolon.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2016
@ghost
Copy link

ghost commented Aug 9, 2016

@cmcewen updated the pull request.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2016
@ekryski
Copy link

ekryski commented Aug 9, 2016

Nice work @cmcewen! Stoked to see this one land.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2016
@ghost
Copy link

ghost commented Aug 9, 2016

@cmcewen updated the pull request.

1 similar comment
@ghost
Copy link

ghost commented Aug 9, 2016

@cmcewen updated the pull request.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2016
@satya164
Copy link
Contributor

LGTM.

cc @dmmiller @foghina do you think this is good to go?

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 10, 2016
@dmmiller
Copy link

Seems good to me, but I'd like @andreicoman11 to look at it since he wrote the permissions module piece.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 10, 2016
@andreicoman11
Copy link
Contributor

@facebook-github-bot shipit

@ghost ghost added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Aug 15, 2016
@ghost
Copy link

ghost commented Aug 15, 2016

Thanks for importing.If you are an FB employee go to Phabricator to review internal test results.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 15, 2016
@ghost ghost closed this in 0fb2ccf Aug 15, 2016
cmcewen added a commit to cmcewen/react-native that referenced this pull request Aug 15, 2016
ghost pushed a commit that referenced this pull request Aug 16, 2016
Summary:
This is a follow-up to #9292 satya164
Closes #9325

Differential Revision: D3723568

fbshipit-source-id: d553a70bde53ed5d7c1f5f544c85c5c5935e3ca4
mpretty-cyro pushed a commit to HomePass/react-native that referenced this pull request Aug 25, 2016
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
rozele pushed a commit to microsoft/react-native-windows that referenced this pull request Aug 25, 2016
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
@cinder92
Copy link

is this available in RN 0.37?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants