priteshrnandgaonkar / react-native-call-detection

react-native package to detect call states
MIT License
191 stars 110 forks source link

Fix/request permission android Call-Log. #77

Closed ikendoit closed 4 years ago

ikendoit commented 4 years ago

Hopefully resolving [https://github.com/priteshrnandgaonkar/react-native-call-detection/issues/76](android empty phone number)

I had the same issue: image

After checking https://stackoverflow.com/questions/13154445/how-to-get-phone-number-from-an-incoming-call - Amjad Alwareh's answer, I have learned that we need READ_CALL_LOG.

My android version is 11, so I made this patch and it worked as expected. image

Let me know your thoughts! Thanks for making this great library.

Kraudia commented 4 years ago

Hi! I am glad you have worked on that. I have just tested your solution on device with Android 9 and it works not exactly as I have expected because it asks about read call log only the second time after reload app. I mean I got only READ_PHONE_STATE first and then after restarting app I got another READ_CALL_LOG. Do you have similar issue?

ikendoit commented 4 years ago

Hello Kraudia,

I didn't noticed that, will hopefully spend sometime this weekend to test again this patch on a new application. Thanks for trying it out!

marcesengel commented 4 years ago

Hey @ikendoit ,

thank you for your contribution! I'm sorry I haven't noticed this PR before. I'll add a little review and would love to hear back from you.

marcesengel commented 4 years ago

@priteshrnandgaonkar would you be so kind to push a new version to npm?