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

Android API level 22 crashes on getAll() #331

Closed
glocore opened this issue Oct 5, 2018 · 10 comments
Closed

Android API level 22 crashes on getAll() #331

glocore opened this issue Oct 5, 2018 · 10 comments

Comments

@glocore
Copy link
Contributor

glocore commented Oct 5, 2018

Whenever I tried to access contacts through the getAll() method on a Nexus 4 running Android 5.1.1 Lollipop (API level 22), the app would immediately crash without warning. I checked logcat, and found out that a permission for READ_PROFILE was also required. I added that to AndroidManifest.xml and everything worked fine.
Also, the permission granted status is represented as a boolean true value rather than the string 'granted'. This is also a condition that needs to be handled separately for older versions of Android (<= API level 22).

I can create a quick PR for handling this case.

@jamalhassouni
Copy link

+1

@morenoh149
Copy link
Owner

morenoh149 commented Oct 9, 2018

yes if you can submit a PR that supports older versions of android and maintains support for new versions of android as well that would be appreciated @platonish FWIW supporting older phone os versions is not a priority for this project.

@glocore
Copy link
Contributor Author

glocore commented Oct 23, 2018

Hi @morenoh149, sorry for the late response. Actually on second thought, I think it would be better if we simply added a note in the readme regarding this, so that those who don't require it aren't requesting unnecessary permissions. LMK what you think.

@morenoh149
Copy link
Owner

@platonish yes absolutely. If you open PR for the readme I'll merge. Basically, you're suggesting we also list READ_PROFILE in https://github.com/rt2zz/react-native-contacts#android-1 ?

@glocore
Copy link
Contributor Author

glocore commented Oct 24, 2018

@morenoh149 yup pretty much! Take a look 🙂

@ssancheza227
Copy link

Hi @morenoh149, i have same problem :/ and added the permissions but this not working :/. Do i have to do something else?

@morenoh149
Copy link
Owner

@ssancheza227 are you having issues on both platforms? usually the issue is not following the instructions correctly, read the whole readme first then try to install it.

@ssancheza227
Copy link

@morenoh14 I have the problem only in android but only in versions custom for example v5.1.1 in this version the app crash but in v5.0 the app work, maybe i have the force the version in build.gradle :/.

@jamalhassouni
Copy link

jamalhassouni commented Nov 15, 2018

@ssancheza227 I've had the same problem before
The problem was that the phone number was null
I've solved it by displaying data if the phone number is not empty

@ssancheza227
Copy link

@jamalhassouni Great! you would shared your solution in code? please :)

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