首页 > 解决方案 > 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? enter image description here

标签: iosswiftgoogle-signin

解决方案


这样做,您将在委托方法中获得回调。如果失败并出现错误,您必须要求用户重新登录。

guard let googleSignIn = GIDSignIn.sharedInstance() else { return }
    if (googleSignIn.hasPreviousSignIn()) {
      googleSignIn.restorePreviousSignIn()
    }

推荐阅读