{"name":"expo-permissions","version":"1.0.0-rc.1","keywords":["react-native","expo"],"author":{"name":"650 Industries, Inc."},"license":"BSD","_id":"expo-permissions@1.0.0-rc.1","homepage":"https://docs.expo.io/","dist":{"shasum":"7d25986498aea0ff53c88df6583280c9125bf006","tarball":"http://registry-npm.ywwl.com/expo-permissions/download/expo-permissions-1.0.0-rc.1.tgz","fileCount":37,"integrity":"sha512-xPGxqmCe0DbQYT0bn228xx+xoFQzlgrEBZuIjZVe9ANPQxpH6eUdNDGO+ma8PIV3ysXeqVaCWDgBet3KgyUHsQ==","signatures":[{"sig":"MEUCIQDtjvHxjtWZQG/PrdN/8jeQ3ytZ+H7I55GW6T9MwcnQWwIgQo+g6P06POZkQAsc8iIqagSzx/fz13XrSDrAoQHdO9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbTkfuCRA9TVsSAnZWagAAEvkQAIoEDK/l10Veqe4BaIjK\n0CMbU413IgxOQ+zzqrY33uGGy1XH0nNW47++AmLdZ1TsPj/ciPgxwIOgn3Gc\nylS8T2opMHiA2yyxYlnw3wVleVaBbAOuiZsFtj67yQPlSqG9K1Eoi+zS96iC\nUENjQtbdAh3FV6I221axLiPCf4cGitOvQNUuqa33iQMGlos1yR65QOfRiwfh\n80NHI8qvDij7cpg1D9iNWKEjIlLC9bBPsY9cq7IA+Vo4xhm80KohnoZ5ZgsJ\nHl1MiOAMNe6e7CJz6RMssTK8fZk/y/Ke8HK7yjrLZ5VdhKbmD+uWoRpMR7Cc\n/VMeYHxDkfyMXb+XLRcLRLCnf/PkoutsN+z3IC5MeaYSnNu8KqpiAkoYaUvs\n2GA2+pLCY0A/q+ZlyvH7pXTyzObJk3ekxgHCMq9WgwksrEVUiCyfDJUNTcQF\nzX3VR8I5bbDjjsJwVj5+coNXHEpyF/+Xa4U/MGceW2YaZGenOeSj4GX1Dolz\nubmwhiCB4dPwUujcS6+sQngpcLz/z/jJ8DJLMaF3zmUvq/catBsFQyNPbnFU\n6oGSbN9ixYUXMhED/DRX0p+W0HUraaH7lZnPRknLNz6U9LGUdQErSWe9S3sQ\nA/T/5YUiQHrAghO9sBsq2PcqPcvqclv8X86iN4njEnsa6K98q5KWufchmS6L\nuRJv\r\n=cXus\r\n-----END PGP SIGNATURE-----\r\n","size":35181,"noattachment":false,"key":"/expo-permissions/-/expo-permissions-1.0.0-rc.1.tgz"},"main":"index.js","_from":"file:expo-permissions-1.0.0-rc.1.tgz","_npmUser":{"name":"tsapeta","email":"sapeta.tomasz@gmail.com"},"_resolved":"","_integrity":"","_npmVersion":"6.1.0","description":"Expo Module Template standalone universal module","directories":{},"_nodeVersion":"9.5.0","dependencies":{"expo-core":"^null","expo-permissions-interface":"^1.0.0-rc.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/expo-permissions_1.0.0-rc.1_1531856878566_0.04750130176692635","host":"s3://npm-registry-packages"},"readme":"# expo-permissions\n\n## Installation\n\n### iOS (Cocoapods)\n\nIf you're using Cocoapods, add the dependency to your `Podfile`:\n\n`pod 'EXPermissions'`\n\nand run `pod install`.\n\n### iOS (no Cocoapods)\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `expo-permissions` and add `EXPermissions.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libEXPermissions.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project (`Cmd+R`).\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   ```\n\n## Introduction\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](../guides/app-stores.html#system-permissions-dialogs-on-ios).\n\n### `Permissions.getAsync(type)`\n\nDetermines whether your app has already been granted access to the provided permission type.\n\n#### Arguments\n\n-   **type (_string_)** -- The name of the permission.\n\n#### Returns\n\nReturns a `Promise` that is resolved with the information about the permission, including status, expiration and scope (if it applies to the permission type).\n\n#### Example\n\n```javascript\nimport { Permissions } from 'expo-permissions';\n\nasync function alertIfRemoteNotificationsDisabledAsync() {\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```\n\n### `Permissions.askAsync(type)`\n\nPrompt the user for a permission. If they have already granted access, response will be success.\n\n#### Arguments\n\n-   **type (_string_)** -- The name of the permission.\n\n#### Returns\n\nReturns a `Promise` that is resolved with the information about the permission, including status, expiration and scope (if it applies to the permission type).\n\n#### Example\n\n```javascript\nimport { Location } from 'expo';\nimport { Permissions } from 'expo-permissions';\n\nasync function getLocationAsync() {\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.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","publish_time":1531856878662,"maintainers":[{"email":"radoslaw.krzemien@swmansion.com","name":"radoslawkrzemien"},{"email":"piotrek.szeremeta@swmansion.com","name":"pkham"},{"email":"szymon.dziedzic@swmansion.com","name":"szdziedzic"},{"email":"npm@tsapeta.com","name":"tsapeta"},{"email":"ide+npm@jameside.com","name":"ide"},{"email":"kosmatylukasz@gmail.com","name":"lukmccall"},{"email":"beto@expo.io","name":"betoatexpo"},{"email":"phil@kitten.sh","name":"philpl"},{"email":"brent+expobotnpm@expo.io","name":"expo-bot"},{"email":"hughesno1@gmail.com","name":"alanhughes"},{"email":"hellokadi@gmail.com","name":"kadikraman"},{"email":"mikucki@gmail.com","name":"aleqsio"},{"email":"mwlawlor@gmail.com","name":"marklawlor"},{"email":"donadeldev@gmail.com","name":"gabrieldonadel"},{"email":"gosimek@gmail.com","name":"simek"},{"email":"keith@expo.io","name":"keith-kurak"},{"email":"chris@christopherwalter.com","name":"christopherwalter"},{"email":"datwheat@gmail.com","name":"fiber-god"},{"email":"brentvatne@gmail.com","name":"brentvatne"},{"email":"baconbrix@gmail.com","name":"evanbacon"},{"email":"quinlanjung@gmail.com","name":"quinlanj"},{"email":"support@expo.io","name":"expoadmin"},{"email":"exponent.team@gmail.com","name":"exponent"},{"email":"wschurman@gmail.com","name":"wschurman"},{"email":"me@bycedric.com","name":"bycedric"},{"email":"sampjon@gmail.com","name":"jonsamp"},{"email":"mhampton@hey.com","name":"princefleaswallow"},{"email":"ckchien@gmail.com","name":"kudochien"},{"email":"ccheever@gmail.com","name":"ccheever"},{"email":"jesseruder@gmail.com","name":"jesseruder"},{"email":"ben@exp.host","name":"terribleben"},{"email":"sjchmiela@gmail.com","name":"sjchmiela"},{"email":"eric@expo.io","name":"esamelson"}],"_cnpm_publish_time":1531856878662,"dist-tags":{"latest":"14.4.0"}}