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

Permission Denial : Opening provider com.android.provider.contact.contactProvider2 #82

Open
onusgit opened this issue Oct 6, 2018 · 4 comments

Comments

@onusgit
Copy link

onusgit commented Oct 6, 2018

I am not access my device contact in android device.

I set Permission in AndroidManifest.xml file

<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

screen shot 2018-10-06 at 10 43 30 am

@joshuapinter
Copy link
Owner

What Android version?

@harunsmrkovic
Copy link
Contributor

@onusgit I guess you're hitting the same issue as I have, and that is trying to access contacts without first checking for permissions. Check out the methods for this here https://github.com/joshuapinter/react-native-unified-contacts#can-the-user-access-contacts

@the-nippy
Copy link

the-nippy commented Jul 8, 2019

if your andoid version >=6 ,you should add this in your MianActivity . You can also add it in other place but should be called to ensure the permission when application starts.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, 1);
    }
}

image

@onusgit

@Nargesi1990
Copy link

if your andoid version >=6 ,you should add this in your MianActivity . You can also add it in other place but should be called to ensure the permission when application starts.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, 1);
    }
}

image

@onusgit

i also have the same errors, you can tell me where exactly should i enter this code, because i entered this code in my code but i have another error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants