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

Feat: Do not require android.permission.WRITE_CONTACTS #119

Open
qliqdev opened this issue Apr 22, 2024 · 3 comments
Open

Feat: Do not require android.permission.WRITE_CONTACTS #119

qliqdev opened this issue Apr 22, 2024 · 3 comments

Comments

@qliqdev
Copy link

qliqdev commented Apr 22, 2024

Is your feature request related to a problem? Please describe.
As we can see in plugin initialization code

@CapacitorPlugin(
    name = "Contacts",
    permissions = { @Permission(strings = { Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS }, alias = "contacts") }
)

Plugin requires Manifest.permission.WRITE_CONTACTS. that's why Google Play always throw annoying warning before publising release
image

Describe the solution you'd like
Permissions should be configurable by client side.

Describe alternatives you've considered
It would be better if we could configure permissions in capasitor.confit.ts or when calling requestPermissions method

@sergiomilici
Copy link

I have the same issue. It's always requiring WRITE_PERMISSION when I just read the contacts.

@reslear
Copy link
Contributor

reslear commented Jul 27, 2024

I also encountered an error while trying to read contacts using the following code:

AndroidManifest.xml

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

Code

    const { contacts } = await Contacts.getContacts({
      projection: {
        name: true,
      },
    })

The error message I received is:

Msg: Error: Missing the following permissions in AndroidManifest.xml: android.permission.WRITE_CONTACTS

Application is requesting android.permission.WRITE_CONTACTS even though the intention is ONLY to READ contacts.

@tafelnl there's no way around it?

@NoobleMcScrunchkin
Copy link

Hiya, I've also been looking to remove unnecessary permissions, and have seen the same issue as above when only using READ_CONTACTS and the getContacts method. Would love to see this improved.

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

4 participants