在iOS上自动启动Google Authenticator应用程序

在iOS上启动Google Authenticator是否有支持的方式?

我想让客户更容易打开应用程序,然后复制基于时间的代码,然后粘贴到我的应用程序中。

我经验地发现,这个(Swift)代码将启动应用程序:

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

…但是我想知道是否有一个更好的,支持的方式。

具体来说,otpauth://协议是否支持没有参数来简单地启动应用程序?

看看应用程序的Git回购看起来好像他们已经注册了bot otpauthtotp的自定义URL Schemes

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

这里是关于如何build立url的文档:

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

在您正确地形成它们并在相同的设备上获得您的应用程序和Google身份validation器应用程序后,您只需要进行testing即可。