Automatic detect user mobile number

Hi Guys,

I am new on Ionic and Angular need some suggestion,
1: How i will know User Already Verified By OTP, means if user verified then i will not ask again for OTP and If user not verified then will prompt for “Enter Mobile Number for OTP”

Where I can Store Mobile Number, Status and User ID Locally - Below explanation
" Once User verified App will store the Mobile Number and Status , So that whenever User open the app for Delivery Order, I can get automatic details of Address and Order History"

Hi,

You can get the phone number with a Cordova plugin.

Try this (I didn’t use it or test it but it should work), it seems that Apple don’t let you access the user phone number from your app, so it will only work on Android.

As for store the Mobile Number Status and User Id you can store it in Local Storage there’s no need to a database for that. You can see how to use it here:

http://learn.ionicframework.com/formulas/localstorage/

I didn’t put some code to help because i think it’s pretty straight forward, but if you need some more help just reply, and I will help you.

Regards,
pcagica

1 Like

Can i store mobile number in localStorage, so that when user open app next time i can get the mobile number and fetch the all details from server for user.

yes you can store the user’s mobile number in localStorage, and when the use visit you app next time you can identify him by checking the mobile number exists or not and the you can proceed

2 Likes

Thanks Dhruv. You cleared my confusion.