-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
Ran CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.A question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
I'm new at react native and typescript.I wanna create permissions module for my react native project and I seperated two links at below Yonah's project and Facebook's permissions project
Additionaly
npm install ,npm start , yarn run build --watch and react-native run-android
command running smoothly but permission module dont use it ,I dont present this module add my project.
And my trying link at below ;
const permission = require('react-native-permissions')
import React from 'react'
import {
StyleSheet,
TouchableHighlight,
Text,
View,
Alert,
AppState,
Platform,
PermissionsAndroid,
} from 'react-native'
interface Props {
names: string[]
}
interface PermissionsState {
status: PermissionStatus
}
type PermissionStatus = 'granted' | 'denied' | 'never_ask_again' | ''
export class permissions extends React.Component<Props, PermissionsState>
{
constructor(props: Props, context: any)
// tslint:disable-next-line:brace-style
{
super(props, context)
this.state = {
status: '',
}
}
public render()
// tslint:disable-next-line:brace-style
{
return (<View> a </View>)
}
}
async function requestCameraPermission() {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.CAMERA,
)
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
// console.log("kamerayı kullanabilirsiniz")
} else {
// console.log('kamerayı kullanamazsınız')
}
} catch (err) {
// console.warn(err)
}
}
export default permission
Metadata
Metadata
Assignees
Labels
Ran CommandsOne of our bots successfully processed a command.One of our bots successfully processed a command.Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.A question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.