Hi iam trying to send top to mobile number using Firebase Authentication,and am able to do that but my task is sending OTP to phone number and as per the country code, if the user choose wrong country code then OTP should not sent and if it is correct then only we have to send the OTP.and this OTP verification should be done only for the first time.If they already done the OTP verification after re-running the application ,we should directly go to home page.Can anyone help me to do that would be great ,thanks in advance.
Asked
Active
Viewed 462 times
1 Answers
0
I think the country code should not be editable. If it is for verification purposes only, you can get country code with the help of the below code.
let currentLocale = NSLocale.currentLocale()
let countryCode = currentLocale.objectForKey(NSLocaleCountryCode) as? String
After getting this you can append this with a mobile number like this.
let FinalNumber = String(format: "%@%@", countryCode,mobilenumber)
- When it comes to navigating view controllers : this will help you

Patel
- 43
- 6