ios - 在 iOS 上自动启动 Google Authenticator 应用

标签 ios google-authenticator

是否支持在 iOS 上启动 Google 身份验证器的方式?

我想让客户更轻松地打开应用并复制基于时间的代码,然后再将其粘贴回我的应用。

我根据经验发现此 (Swift) 代码将启动该应用程序:

UIApplication.sharedApplication().openURL(NSURL(string: "otpauth://")!)

...但我想知道是否有更好的支持方式。

具体来说,是否支持不带参数的 otpauth://协议(protocol)以简单地启动应用程序?

最佳答案

查看该应用程序的 Git 存储库,他们似乎已经为机器人 otpauthtotp 注册了自定义 URL 方案

https://github.com/google/google-authenticator/blob/bd50d15c348a978c314d2b30e586fbc562096223/mobile/ios/OTPAuth-Info.plist#L42

这里

https://github.com/google/google-authenticator/blob/bd50d15c348a978c314d2b30e586fbc562096223/mobile/ios/Classes/OTPAuthURL.h#L23

这里是关于如何准确构建 url 的文档:

https://github.com/google/google-authenticator/wiki/Key-Uri-Format

在您正确形成它们并在同一台设备上安装您的应用程序和 Google 身份验证器应用程序后,您只需要进行测试即可。

关于ios - 在 iOS 上自动启动 Google Authenticator 应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32043500/

相关文章:

ios - Swift:UIButton 触摸事件未在自定义 View 中调用

python - 生成的代码与 PyOTP 示例不匹配

asp.net-core-mvc - 带有 ASP.NET Core 的谷歌身份验证器

linux - 无法连接 openvpn ubuntu 16.04

ios - 是否可以观察来自不同类的 NSMutableArray?

ios - 应用内购买问题: Purchase not persist

google-authenticator - Google Authenticator 或 FreeOTP 中的 token 图像

objective-c - 当应用程序进入前台时取消后台任务

iphone - 如何验证字符串是否为字母数字