Sagar
Sagar

Reputation: 1304

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.

Upvotes: 3

Views: 2724

Answers (1)

Rony Rozen
Rony Rozen

Reputation: 4047

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.

Upvotes: 5

Related Questions