简体   繁体   English

在iOS中检索SMS文本

[英]Retrieve the SMS text in iOS

I have an app which will uses OTP (one-time password) value send via SMS 我有一个应用程序将使用通过短信发送的OTP(一次性密码)值

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. 我想在我的UIView上显示这个MSG,它将有OK Button。 and onClick on OK Button I have to copy OTP '####' to my UITextField . 并点击OK按钮我必须将OTP'####'复制到我的UITextField

So my question is, is it possible to get the SMS text into your app in iOS. 所以我的问题是,是否可以将SMS文本放入iOS中的应用程序中。 The links that I searched shows that, Its only possible with JailBreak. 我搜索的链接显示,它只能与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. 如果不可能,那么链接将以书面形式显示我可以向我的经理显示并做出相应的决定。

It's impossible to access the user's SMS messages on both the simulator and on the real device (unless it's jailbroken). 在模拟器和真实设备上访问用户的SMS消息是不可能的(除非它已越狱)。 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. 与Android不同,Apple的隐私限制不允许开发人员有权访问用户的个人数据,如短信,电话等。您可以看到各种示例。 For example, try Whatsapp registration process on both iPhone and Android. 例如,在iPhone和Android上尝试Whatsapp注册过程。 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. 在两者上,您将收到带有代码的短信,但在Android上,代码将被魔术输入并通过应用程序验证,在iPhone上您将看到收到的短信并被要求手动输入代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM