pentarex / react-native-gallery-manager

30 stars 41 forks source link

Added requestAuthorization func to objc and js file #6

Closed rangav closed 6 years ago

rangav commented 6 years ago

This is useful to check authorization - if access granted then we can get the photos immediately without refresh of the view. currently not possible.

example usage:

GalleryManager.requestAuthorization().then(status => {
            console.log(status);
            if (status.isAuthorized) {
                // get photos
                GalleryManager.getAssets({
                type: 'all',
                limit: 10,
                startFrom: 0
              })
                 .then(r => {
                    console.log(r)
             }
       }
}