Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import permissions module on react native project? #15308

Closed
boga01 opened this issue Aug 1, 2017 · 7 comments
Closed

How to import permissions module on react native project? #15308

boga01 opened this issue Aug 1, 2017 · 7 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot.

Comments

@boga01
Copy link

boga01 commented Aug 1, 2017

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
@charpeni
Copy link
Contributor

charpeni commented Aug 1, 2017

@facebook-github-bot stack-overflow

@facebook-github-bot
Copy link
Contributor

Hey @boga01, thanks for posting this! @charpeni tells me this issue looks like a question that would be best asked on Stack Overflow. Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. See "What to Expect from Maintainers".

@facebook-github-bot
Copy link
Contributor

Something went wrong executing that command, @mkonicek could you take a look?

@boga01
Copy link
Author

boga01 commented Aug 1, 2017

@facebook-github-bot @mkonicek thanks for comment I know I asked this question on stackoverflow myself,but dont answer suitable,I just try this platform for chance.

@charpeni charpeni mentioned this issue Aug 1, 2017
@boga01
Copy link
Author

boga01 commented Aug 1, 2017

@mkonicek Is it any idea this situation 🥇

@charpeni
Copy link
Contributor

charpeni commented Aug 2, 2017

@facebook-github-bot stack-overflow

@facebook-github-bot
Copy link
Contributor

Hey @boga01, thanks for posting this! @charpeni tells me this issue looks like a question that would be best asked on Stack Overflow. Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. See "What to Expect from Maintainers".

@facebook-github-bot facebook-github-bot added the Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. label Aug 2, 2017
@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Aug 2, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Aug 2, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants