1

I am trying to build a react-native application in which i want to auto detect the mobile phone numbers of the user.

for ex: if i have a dual sim phone and have two sim-cards then i should get the phone numbers of those two simcard.

I have tried react-native-sim-data but it is not working also tried react-native-device-info, it is working but it is only giving me a single phone number

please help me.

i am attaching a screenshot of what i am expecting. enter image description here

Shail Patel
  • 187
  • 2
  • 11
  • On iOS you will need to ask the user for their phone number(s). Apps cannot access them for privacy reasons – Paulw11 Jun 02 '22 at 07:36
  • ohh okaayy but i guess in android it is possible. I have seen this feature in many apps – Shail Patel Jun 02 '22 at 08:07
  • 1
    Have you found a solution @ShailPatel? There are a couple of packages out there who can do it: e.g. https://www.npmjs.com/package/react-native-sms-retriever However: they will crash for Android 12 and are not actively maintained. If you are familiar with native code (unfortunately, I am not), then it is probably the best idea if you implement it by yourself. You will find a documentation with the latest API here: https://developers.google.com/identity/phone-number-hint/android – RaideR Aug 09 '22 at 13:35
  • @RaideR i am using npmjs.com/package/react-native-sms-retriever but as you correctly said the app is getting crashed in android 12. i am not so familiar with native code but yes i will try to find something in the documentation that you shared Thank You – Shail Patel Aug 16 '22 at 01:46

0 Answers0