ios - How to check Google sign-in validation in iOS after remove access from user Security account
问题描述
How to validate or check the google sign in user, if the user is removed access from their account management or still valid? image shown below. i have tried out
if(GIDSignIn.sharedInstance()?.currentUser != nil)
and
guard let googleSignIn = GIDSignIn.sharedInstance() else { return } if (googleSignIn.hasPreviousSignIn()) { googleSignIn.restorePreviousSignIn() }
.
but it doesn't work out. How to validate the user if removed access or not.
Can anyone help on this?
解决方案
这样做,您将在委托方法中获得回调。如果失败并出现错误,您必须要求用户重新登录。
guard let googleSignIn = GIDSignIn.sharedInstance() else { return }
if (googleSignIn.hasPreviousSignIn()) {
googleSignIn.restorePreviousSignIn()
}
推荐阅读
- prolog - 我的 Swi-prolog 代码对每个查询都返回 true
- javascript - 如何在nodejs中的JSON数组末尾添加一个新元素
- android - 如何从放置在资产文件夹中的Android数据库文件中读取版本号
- android - 从相机中捕获图像片段丢失,导航到上一个片段
- highcharts - 在 highcharts 中工作但不在 highstock 中的工具提示
- cefsharp - 如何防止 CEFSharp 应用程序访问寡妇资源
- javascript - Firefox 浏览器的全局 Javascript 样式扩展
- zoho - Zoho Desk 无效的 oauth
- python - 无法在训练前提供预训练词嵌入
- node.js - AWS IoT 事物在订阅后自动断开连接