*
Error code 500 is an internal server error. so check issues using postman.
@IBAction func GoogleLoginBtn(_ sender: Any) {
GIDSignIn.sharedInstance().signIn()
}
func sign(_ signIn: GIDSignIn!, didDisconnectWith user:GIDGoogleUser!,withError error: Error!) {
print(error)
return
}
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
if (error == nil) {
// Perform any operations on signed in user here.
id = user.userID
Name = user.profile.name
Email = user.profile.email
url = String(describing: user.profile.imageURL(withDimension: (400))!)
}
}
In-app delegate:-
GIDSignIn.sharedInstance().clientID = "76lp4.apps.googleusercontent.com"
// paste ur reverse client id here
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
print("UIApplicationOpenURLOptionsKey.sourceApplication.rawValue: \(UIApplicationOpenURLOptionsKey.sourceApplication.rawValue)")
print("UIApplicationOpenURLOptionsKey.annotation.rawValue: \(UIApplicationOpenURLOptionsKey.annotation.rawValue)")
return GIDSignIn.sharedInstance().handle(url as URL?,
sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String?,
annotation: options[UIApplicationOpenURLOptionsKey.annotation])
}
*