react native qrcode scanner permission
_requestPermission = permission => {var optionsif (permission == 'location') { options = this.state.isAlways ? 'always' : 'whenInUse'}Permissions.request(permission, options) .then(res => { this.setState({ status: { ...this.state.status, [permission]: res }, }) if (res != 'authorized') { var buttons = [{ text: 'Cancel', style: 'cancel' }] if (this.state.canOpenSettings) buttons.push({text: 'Open Settings', onPress: this._openSettings, })Alert.alert( 'Whoops!','There was a problem getting your permission. Please enable it from settings.',buttons,) } }) .catch(e => console.warn(e)) }
Also in JavaScript:
- angularjs form validation on submit
- sttripe for payment in react native andorid
- reference self in ajax callback
- redux middleware
- js fetch api
- javascript get elements that exist in two arrays
- sigma js load json
- sending json data uing fetch is empty
- dynamic loaded content can't find library jqury
- node module export multiple functions
- redirect with javascript to another page
- how to convert json to javascript object
- javascript echo
- insert json file in python
- javascript how to set cursor for whole page
- javascript nth root
- how to add all values of array together js
- live background react
- javascript object to array
- ejs / javascript check if array/object exists and is not empty
- how to update node
- let scores = [80, 90, 70]; for (const score of scores) { console.log(score); }
- uuid react
- React get method