{"dist":{"shasum":"a0a77b0dd655801fb64971ac37704bef26cc118b","tarball":"https://registry.npmjs.org/expo-permissions/-/expo-permissions-2.0.0-rc.2.tgz","fileCount":41,"integrity":"sha512-XE/Hno/HGhR95CRaoGdv5FX44zSdqcqPSmBWBRrhxmbUUPmBcV3gtvxWh5XYVwQkOiUveljmUmAmVBG5HU275g==","signatures":[{"sig":"MEUCIQDgRbvHI/TtaW4BjvZRSwjt+4D9YkSKq6YQm5dFilX1pQIgPY5NRCWPcBv1v2QwHF/OR3KtefkHUXYnC6BwySj5HS8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":99441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLgm/CRA9TVsSAnZWagAAphoP/iQ7h1MViu+xf6DewpGX\nLorskAwj8TKPwDRtP4gGkRJlhpOsoO9BlyX7QFaulo5oek01pa5J3bzC8aw5\nfETlDIyfc7zryfGhw9zEU/T8qJwRfyiDwHc5U1hsZfM6TFbUfkbgV2/TPOCS\nw/O0397aOu5R1OC5JkdSnVN+sOtHk+/stmSofuHmJaproFdp9Lg4Ql71OD6k\niahQwmlih+owF4VA72UXnV2SuX8F6sx0hm6UFN3M04RconexL9CdPnSUJBK3\nGx3QOaAeKy/F+NKDRfigr7LPQP6MDTO8/ObeEG9eJnRU/TPhrPgOc0sYFJ8a\nBXatD1jHlCKTZoxFXpsQPlp6oOSXg9UuvuMu7OwStYiSjsg7CjcztdVrc521\ncKq4cRevm1dNclKmhKE5LywMnHeofmH8Bq8WvKYM3AiaSS3l1AMncq4qP1OL\n/m7XPMJYcfQhPWPbD1pTeZZjsKwaM4qlEY1r2mjLjJ/wT5zY0nFi6grVVHT9\nv5avNeGVYWIt8w/QA3KP1rDV+T3GDhjXSvbTQWXxpZnzuTZCYg/aDUkSL/GM\nisNsxxlTruxgCc+THoJ5epuW36IzXCIADsAHfRBNR7COzXQx2qIFQhoQ+gXs\nyVtuumAH5qbhW/zhNub5YURAzmL1TnhC5XOzbsd3VLWFILfu4I88ScAPk4a+\ntj0k\r\n=KG0Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","name":"expo-permissions","author":{"name":"650 Industries, Inc."},"readme":"# expo-permissions\n\nWhen it comes to adding functionality that can access potentially sensitive information on a user's device, such as their location, or possibly send them possibly unwanted push notifications, you will need to ask the user for their permission first. Unless you've already asked their permission, then no need. And so we have the `Permissions` module.\n\nIf you are deploying your app to the Apple iTunes Store, you should consider adding additional metadata to your app in order to customize the system permissions dialog and explain why your app requires permissions. See more info in the [App Store Deployment Guide](https://docs.expo.io/versions/latest/guides/app-stores.html#system-permissions-dialogs-on-ios).\n\n## Installation\n\n*If your app is running in [Expo](https://expo.io) then everything is already set up for you, just `import { Permissions } from 'expo';`*\n\nOtherwise, you need to install the package from `npm` registry.\n\n`yarn add expo-permissions` or `npm install expo-permissions`\n\nAlso, make sure that you have [expo-core](https://github.com/expo/expo-core) installed, as it is required by `expo-permissions` to work properly.\n\n### iOS\n\nAdd these dependencies to your `Podfile`:\n\n```ruby\npod 'EXPermissions', path: '../node_modules/expo-permissions/ios'\npod 'EXPermissionsInterface', path: '../node_modules/expo-permissions-interface/ios'\n```\n\nand run `pod install` under the parent directory of your `Podfile`.\n\n### Android\n\n1. Append the following lines to `android/settings.gradle`:\n   ```gradle\n   include ':expo-permissions'\n   project(':expo-permissions').projectDir = new File(rootProject.projectDir, '../node_modules/expo-permissions/android')\n   ```\n   and if not already included\n   ```gradle\n   include ':expo-permissions-interface'\n   project(':expo-permissions-interface').projectDir = new File(rootProject.projectDir, '../node_modules/expo-permissions-interface/android')\n   ```\n2. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n   ```gradle\n   compile project(':expo-permissions')\n   ```\n   and if not already included\n   ```gradle\n   compile project(':expo-permissions-interface')\n   ```\n3.  Add `new PermissionsPackage()` to your module registry provider in `MainApplication.java`.\n\n## Methods\n\n### `Expo.Permissions.getAsync(...permissionTypes)`\n\nDetermines whether your app has already been granted access to the provided permissions types.\n\n#### Arguments\n\n-   **permissionTypes (_string_)** -- The names of the permissions types.\n\n#### Returns\n\nReturns a `Promise` that is resolved with the information about the permissions, including status, expiration and scope (if it applies to the permission type).\nTop-level `status` and `exprires` keys stores combined info of each component permission that is asked for.\nIf any permission resulted in negative result than that negative result is propagated here, that means top-level values are positive only if all component values are positive.\n\nExamples `[...componentsValues] => topLevelStatus`: \n* `[granted, denied, granted] => denied`\n* `[granted, granted, granted] => granted`\n\n```javascript\n{\n  status, // combined status of all component permissions being asked for, if any of has status !== 'granted' then that status is propagated here\n  expires, // combined expires of all permissions being asked for, same as status\n  permissions: { // an object with an entry for each permission requested\n    [Permissions.TYPE]: {\n      status,\n      expires,\n      ... // any additional permission-specific fields\n    },\n    ...\n  },\n}\n```\n\n#### Example\n\n```javascript\nasync function alertIfRemoteNotificationsDisabledAsync() {\n  const { Permissions } = Expo;\n  const { status } = await Permissions.getAsync(Permissions.NOTIFICATIONS);\n  if (status !== 'granted') {\n    alert('Hey! You might want to enable notifications for my app, they are good.');\n  }\n}\n\nasync function checkMultiPermissions() {\n  const { Permissions } = Expo;\n  const { status, expires, permissions } = await Permissions.getAsync(Permissions.CALENDAR, Permissions.CONTACTS)\n  if (status !== 'granted') {\n    alert('Hey! You heve not enabled selected permissions');\n  }\n}\n```\n\n### `Expo.Permissions.askAsync(...types)`\n\nPrompt the user for types of permissions. If they have already granted access, response will be success.\n\n#### Arguments\n\n-   **types (_string_)** -- The names of the permissions types.\n\n#### Returns\n\nSame as for `Permissions.getAsync`\n\n#### Example\n\n```javascript\nasync function getLocationAsync() {\n  const { Location, Permissions } = Expo;\n  const { status } = await Permissions.askAsync(Permissions.LOCATION);\n  if (status === 'granted') {\n    return Location.getCurrentPositionAsync({enableHighAccuracy: true});\n  } else {\n    throw new Error('Location permission not granted');\n  }\n}\n```\n\n## Permissions types\n\n### `Permissions.NOTIFICATIONS`\n\nThe permission type for user-facing notifications **and** remote push notifications.\n\n> **Note:** On iOS, asking for this permission asks the user not only for permission to register for push/remote notifications, but also for showing notifications as such. At the moment remote notifications will only be received when notifications are permitted to play a sound, change the app badge or be displayed as an alert. As iOS is more detailed when it comes to notifications permissions, this permission status will contain not only `status` and `expires`, but also Boolean values for `allowsSound`, `allowsAlert` and `allowsBadge`.\n\n> **Note:** On iOS, this does not disambiguate `undetermined` from `denied` and so will only ever return `granted` or `undetermined`. This is due to the way the underlying native API is implemented.\n\n> **Note:** Android does not differentiate between permissions for local and remote notifications, so status of permission for `NOTIFICATIONS` should always be the same as the status for `USER_FACING_NOTIFICATIONS`.\n\n### `Permissions.USER_FACING_NOTIFICATIONS`\n\nThe permission type for user-facing notifications. This does **not** register your app to receive remote push notifications; see the `NOTIFICATIONS` permission.\n\n> **Note:** iOS provides more detailed permissions, so the permission status will contain not only `status` and `expires`, but also Boolean values for `allowsSound`, `allowsAlert` and `allowsBadge`.\n\n> **Note:** Android does not differentiate between permissions for local and remote notifications, so status of permission for `USER_FACING_NOTIFICATIONS` should always be the same as the status for `NOTIFICATIONS`.\n\n### `Permissions.LOCATION`\n\nThe permission type for location access.\n\n### `Permissions.CAMERA`\n\nThe permission type for photo and video taking.\n\n### `Permissions.AUDIO_RECORDING`\n\nThe permission type for audio recording.\n\n### `Permissions.CONTACTS`\n\nThe permission type for reading contacts.\n\n### `Permissions.CAMERA_ROLL`\n\nThe permission type for reading or writing to the camera roll.\n\n### `Permissions.CALENDAR`\n\nThe permission type for reading or writing to the calendar.\n\n### `Permissions.REMINDERS`\n\nThe permission type for reading or writing reminders (iOS only).\n\n### `Expo.Permissions.SYSTEM_BRIGHTNESS`\n\nThe permissions type for changing brighness of the screen\n\n## Android: permissions equivalents inside `app.json`\n\nIf you specified `android.permissions` inside your `app.json` ([read more about configuration](https://docs.expo.io/versions/latest/workflow/configuration.html#android))  you have to use values corresponding to their `Expo.Permissions` equivalents. \n\n| Expo            | Android                                           |\n| --------------- | --------------------------------------------------|\n| LOCATION        | ACCESS\\_COARSE\\_LOCATION, ACCESS\\_FINE_LOCATION   |\n| CAMERA          | CAMERA                                            |\n| AUDIO_RECORDING | RECORD_AUDIO                                      |\n| CONTACTS        | READ_CONTACTS                                     |\n| CAMERA_ROLL     | READ\\_EXTERNAL\\_STORAGE, WRITE\\_EXTERNAL\\_STORAGE |\n| CALENDAR        | READ\\_CALENDAR, WRITE\\_CALENDAR                   |\n","gitHead":"d56980698034063c398c2ed32e065913ba09a757","license":"MIT","_npmUser":{"name":"sjchmiela","email":"sjchmiela@gmail.com"},"homepage":"https://docs.expo.io/","keywords":["react-native","expo","permissions"],"description":"Expo Permissions standalone universal module","directories":{},"maintainers":[{"name":"barthec","email":"bartlomiejbukowski.b@gmail.com"},{"name":"brentvatne","email":"brentvatne@gmail.com"},{"name":"ccheever","email":"ccheever@gmail.com"},{"name":"dsokal","email":"dominiksokal@gmail.com"},{"name":"esamelson","email":"eric@expo.io"},{"name":"evanbacon","email":"baconbrix@gmail.com"},{"name":"expoadmin","email":"support@expo.io"},{"name":"exponent","email":"exponent.team@gmail.com"},{"name":"fson","email":"ville.immonen@iki.fi"},{"name":"ide","email":"ide+npm@jameside.com"},{"name":"jakubste","email":"jakub.ste@gmail.com"},{"name":"jesseruder","email":"jesseruder@gmail.com"},{"name":"nikki93","email":"s.nikhilesh@gmail.com"},{"name":"quinlanj","email":"quinlanjung@gmail.com"},{"name":"sjchmiela","email":"sjchmiela@gmail.com"},{"name":"terribleben","email":"ben@exp.host"},{"name":"tsapeta","email":"sapeta.tomasz@gmail.com"}],"dependencies":{"expo-core":"~2.0.0-rc.3","expo-permissions-interface":"~2.0.0-rc.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"flow-bin":"^0.77.0"},"_npmOperationalInternal":{"tmp":"tmp/expo-permissions_2.0.0-rc.2_1546521022757_0.29086539478656825","host":"s3://npm-registry-packages"},"_id":"expo-permissions@2.0.0-rc.2","version":"2.0.0-rc.2"}