iOS 12 SMS阅读API? [英] iOS 12 SMS Reading API?

查看:99
本文介绍了iOS 12 SMS阅读API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Beta 12版本的iOS 12中,我观察到它在键盘建议中给出了来自SMS的OTP.
那么,他们是否为开发人员创建了任何API?否则那仅仅是操作系统功能.

In Beta version of iOS 12 I have observed it gives OTP(from SMS) in keyboard suggestion.
So is there any API which they have created for developers ? Or that would just be an OS feature.

推荐答案

这是操作系统功能,但您需要设置UITextField的输入视图的textContentType属性oneTimeCode.

It is OS feature but you need to set UITextField's input view’s textContentType property oneTimeCode.

otpTextField.textContentType = .oneTimeCode

注意::安全密码自动填充仅适用于系统键盘,不适用于自定义键盘.

NOTE: Security Code AutoFill will only works with System Keyboard it will not work with custom keyboard.

当您获得OTP时,它将看起来像这样:

When you get OTP it will look something like this:

这篇关于iOS 12 SMS阅读API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆