Read SMS message in iOS

后端 未结 5 967
情书的邮戳
情书的邮戳 2020-12-05 13:42

I\'m an iOS developer and i have tried to build a mobile application with automatic activation functionality, i found more than way to read SMS message but only using privat

5条回答
  •  执念已碎
    2020-12-05 14:33

    For Swift 5:

    From iOS 12 Apple has given support to read the security code (OTP - One Time Passwords) in text fields.

    if #available(iOS 12.0, *) {
                   otpField.keyboardType = .default
                   otpField.textContentType = .oneTimeCode
           } else {
                   // Fallback on earlier versions
    
           }
    

    Or you can add this contentType from storyboard like below:

提交回复
热议问题