New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-permissions

Package Overview
Dependencies
Maintainers
3
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-permissions - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

.flowconfig

7

index.js
// @flow
import { Platform } from 'react-native'
export default (Platform.OS === 'ios'
? require('./index.ios')
: require('./index.android'))
import Permissions from './lib/permissions'
export { Permissions as default }
{
"name": "react-native-permissions",
"version": "1.0.3",
"version": "1.0.4",
"description": "Check user permissions in React Native",

@@ -22,2 +22,3 @@ "author": "Yonah Forst <yonaforst@hotmail.com>",

"devDependencies": {
"flow-bin": "^0.57.3",
"husky": "^0.14.3",

@@ -24,0 +25,0 @@ "lint-staged": "^5.0.0",

@@ -13,3 +13,3 @@ # ☝🏼 React Native Permissions

| ------- | -------------------- |
| 1.0.3 | 0.40 - 0.50 |
| 1.0.4 | 0.40 - 0.50 |
| 0.2.5 | 0.33 - 0.39 |

@@ -191,13 +191,15 @@

// example
Permissions.check('location', 'always').then(response => {
Permissions.check('location', { type: 'always' }).then(response => {
this.setState({ locationPermission: response })
})
Permissions.request('location', 'always').then(response => {
Permissions.request('location', { type: 'always' }).then(response => {
this.setState({ locationPermission: response })
})
Permissions.request('notification', ['alert', 'badge']).then(response => {
this.setState({ notificationPermission: response })
})
Permissions.request('notification', { type: ['alert', 'badge'] }).then(
response => {
this.setState({ notificationPermission: response })
},
)
```

@@ -259,2 +261,19 @@

[here](https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous).
* The optional rationale argument will show a dialog prompt.
```js
// example
Permissions.request('camera', {
rationale: {
title: 'Cool Photo App Camera Permission',
message:
'Cool Photo App needs access to your camera ' +
'so you can take awesome pictures.',
},
}).then(response => {
this.setState({ cameraPermission: response })
})
```
* Permissions are automatically accepted for **targetSdkVersion < 23** but you

@@ -261,0 +280,0 @@ can still use `check()` to check if the user has disabled them from Settings.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc