Browse Source

Update README.md

Yonah Forst 8 years ago
parent
commit
647e696420
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      README.md

+ 9
- 9
README.md View File

2
 Check user permissions (iOS only)
2
 Check user permissions (iOS only)
3
 
3
 
4
 ##What
4
 ##What
5
-Some iOS features require the user grant permission before you can access them.
5
+Some iOS features require the user to grant permission before you can access them.
6
 
6
 
7
 This library lets you check the current status of those permissions. (Note: it _doesn't_ prompt the user, just silently checks the permission status)
7
 This library lets you check the current status of those permissions. (Note: it _doesn't_ prompt the user, just silently checks the permission status)
8
 
8
 
13
 - Photos
13
 - Photos
14
 - Contacts
14
 - Contacts
15
 - Event
15
 - Event
16
-- Bluetooth
16
+- Bluetooth (Peripheral role. Don't use for Central only)
17
 - RemoteNotifications (Push Notifications)
17
 - RemoteNotifications (Push Notifications)
18
 
18
 
19
 ####Example
19
 ####Example
25
     Permissions.locationPermissionStatus()
25
     Permissions.locationPermissionStatus()
26
     .then(response => {
26
     .then(response => {
27
       if (response == Permissions.StatusUndetermined) {
27
       if (response == Permissions.StatusUndetermined) {
28
-        alert("Undetermined");
28
+        console.log("Undetermined");
29
       } else if (response == Permissions.StatusDenied) {
29
       } else if (response == Permissions.StatusDenied) {
30
-        alert("Denied");
30
+        console.log("Denied");
31
       } else if (response == Permissions.StatusAuthorized) {
31
       } else if (response == Permissions.StatusAuthorized) {
32
-        alert("Authorized");
32
+        console.log("Authorized");
33
       } else if (response == Permissions.StatusRestricted) {
33
       } else if (response == Permissions.StatusRestricted) {
34
-        alert("Restricted");
34
+        console.log("Restricted");
35
       }
35
       }
36
     });
36
     });
37
   }
37
   }
53
 
53
 
54
 `contactsPermissionStatus()` - checks for access to the user's address book
54
 `contactsPermissionStatus()` - checks for access to the user's address book
55
 
55
 
56
-`eventPermissionStatus(eventType)` - requires param `eventType`; either `reminder` or `event`. Checks for access to the users calendar events and reminders
56
+`eventPermissionStatus(eventType)` - requires param `eventType`; either `reminder` or `event`. Checks for access to the user's calendar events and reminders
57
 
57
 
58
-`bluetoothPermissionStatus()` - checks the authorization status of the `CBPeripheralManager` (for sharing data while backgrounded)
58
+`bluetoothPermissionStatus()` - checks the authorization status of the `CBPeripheralManager` (for sharing data while backgrounded). Note: _Don't_ use this if you're only using `CBCentralManager`
59
 
59
 
60
 `notificationPermissionStatus()` - checks if the user has authorized remote push notifications. Note: Apple only tells us if notifications are authorized or not, not the exact status. So this promise only returns `StatusUndetermined` or `StatusAuthorized`. You can determine if `StatusUndetermined` is actually `StatusRejected` by keeping track of whether or not you've already asked the user for permission.
60
 `notificationPermissionStatus()` - checks if the user has authorized remote push notifications. Note: Apple only tells us if notifications are authorized or not, not the exact status. So this promise only returns `StatusUndetermined` or `StatusAuthorized`. You can determine if `StatusUndetermined` is actually `StatusRejected` by keeping track of whether or not you've already asked the user for permission.
61
 
61
 
68
 ###iOS
68
 ###iOS
69
 * Run open node_modules/react-native-permissions
69
 * Run open node_modules/react-native-permissions
70
 * Drag ReactNativePermissions.xcodeproj into the Libraries group of your app's Xcode project
70
 * Drag ReactNativePermissions.xcodeproj into the Libraries group of your app's Xcode project
71
-* Add libReactNativePermissions.a to `Build Phases -> Link Binary With Libraries.
71
+* Add libReactNativePermissions.a to `Build Phases -> Link Binary With Libraries.