React-native-permissions: application/component does not refresh after permission change

Created on 1 May 2018  路  3Comments  路  Source: zoontek/react-native-permissions

Describe your environment

  • React-Native : 0.52.0
  • Platform: Android
  • Device ? Galaxy S6
  • OS version : 7.0
  • react-native-permissions : 1.1.1
  • Devtools: Atom
  • (Android only: buildToolsVersion): 26.0.2

How to repeat issue and example

I want to check if my application has permission to the camera, and my code is:

    checkPermissions = () => {
        Permissions.check('camera')
            .then((response) => {
                if (response !== 'authorized') {
                    Permissions.request('camera').then((userResponse) => {
                        if (userResponse !== 'authorized') {
                            this.props.onBack();
                        } else {
                            this.setState({}); // This does not work as well :(
                        }
                    });
                }
            });
    }

checkPermissions is called from componentDidMount method.
If the user click Allow the camera component inside my module remain blocked and the application does not refresh.
I thought that the application refresh automatically when one of its settings change.
When I change the camera settings manually, the application changes.

Any thoughts?

Most helpful comment

I have same issue, has there been any update?

All 3 comments

Same problem I have

I have same issue, has there been any update?

I am closing this since this issue does not exists anymore with the 2.0.0 release.

Was this page helpful?
0 / 5 - 0 ratings