如何自动启动 Google Authenticator iOS 应用程序并从 Objective-c 代码发送数据(颁发者、用户、密码)?
这个问题部分解决了 Swift 但寻找 Objective-c。 Automatically launch Google Authenticator app on iOS
最佳答案
从 iOS 9 开始,您需要做的第一件事是将 url scheme 添加到您的 Info.plist 中,将其列入白名单
<key>LSApplicationQueriesSchemes</key>
<array>
<string>otpauth</string>
</array>
然后要启动 Google 身份验证器,您需要做的就是:
NSString *otpString = @"otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example";
NSURL *otpURL = [NSURL URLWithString:otpString];
if ([[UIApplication sharedApplication] canOpenURL:otpURL]) {
[[UIApplication sharedApplication] openURL:otpURL];
}
• 有用 page用于生成 Google 身份验证器 URL。
• 您可以查看谷歌解析网址的内部代码here .
关于ios - 在 objective-c 中从另一个 iOS 应用程序设置 Google Authenticator?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33089093/