我在authenticated
上使用了Google,通过fast-app-switch.
,我看到了无声身份验证和google。从第二次开始,我想用我的应用程序实现无声身份验证。也就是说,如果用户第一次尝试登录,我将使用safari重定向以进行身份验证(现在我已经完成了)。但是第二次,我只是通过检查一些条件来调用静默身份验证,比如身份验证令牌是过期的还是其他条件。
伪码..。
if (....what condition...)
[signIn trySilentAuthentication];
建议我如何检查这个条件并调用slientAuthentication
注意:--我见过这个问题--[QA1](https://stackoverflow.com/questions/9209850/google-plus-authentication),[QA2](https://stackoverflow.com/questions/20123341/google-plus-sdk-not-refreshing-token-ios),[QA3],但是所有的问题都是关于身份验证的,而不是关于无声身份验证的。
发布于 2014-03-05 05:14:50
最后,我通过做一些练习找到了。您可以看到下面的代码。
GPPSignIn *signIn = [GPPSignIn sharedInstance];
if ([[GPPSignIn sharedInstance]hasAuthInKeychain])
{
if (![signIn trySilentAuthentication])//because some time, it may expired
[self initialAuthentication];
}
else
{
[self initialAuthentication];
}
https://stackoverflow.com/questions/22165457
复制相似问题