Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve the SMS text in iOS

I have an app which will uses OTP (one-time password) value send via SMS

I wanted to do use this SMS text.

Thank you for the Registration, Your verification code is '####'.Please do not reply to this message

I wanted to show this MSG on my UIView which will have OK Button. and onClick on OK Button I have to copy OTP '####' to my UITextField.

So my question is, is it possible to get the SMS text into your app in iOS. The links that I searched shows that, Its only possible with JailBreak.

But I need some proper answer, so that If it is possible then how I can achieve it. If not possible then link which will show me in written that I can show to my manager and take decision accordingly.

like image 552
Sagar Avatar asked Dec 31 '25 23:12

Sagar


1 Answers

It's impossible to access the user's SMS messages on both the simulator and on the real device (unless it's jailbroken). Unlike on Android, Apple's privacy constraints don't allow developers the right to access the users' personal data such as text messages, phone calls, etc. You can see various examples for this. For example, try Whatsapp registration process on both iPhone and Android. On both, you'll receive a text message with the code, but while on the Android the code will be magically inputted and verified by the app, on the iPhone you'll see the received text message and be asked to manually type the code.

like image 168
Rony Rozen Avatar answered Jan 02 '26 16:01

Rony Rozen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!