I am trying to use the google federated sign-in feature provided by Cognito in an iOS App using AWSMobileClient. I have the latest amplify (4.11.0) and AWS toolkit.
I have the following in my pod file:
pod 'AWSAPIGateway'
pod 'AWSMobileClient'
pod 'AWSAuthUI'
pod 'AWSUserPoolsSignIn'
pod 'GoogleSignIn'
pod 'AWSGoogleSignIn'
I use the standard AWSMobileClient
initialize call and then showSignIn
method to bring the login screen, but I get the following exception:
'NSUnknownKeyException', reason: '[<GIDSignIn 0x600003f19e00> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key uiDelegate.'
My awsconfiguration
file has the following entry:
"GoogleSignIn": {
"Permissions": "email,profile,openid",
"ClientId-WebApp": "XXXXXXXXX-YYYYYYYYYYYYYY.apps.googleusercontent.com",
"ClientId-iOS": "ZZZZZZZZZZZ-VVVVVVVVVVVVV.apps.googleusercontent.com"
}
which was generated by amplify when I created the auth backend (along with other entries for the user pool, identity etc). I have also setup the necessary project and credentials on the google developer website.
Using the Cognito hosted UI (browser URL), I can login with google with no issue, just not using the iOS app.
If I remove the ClientId-iOS entry, the exception does not occur anymore, but the login screen does not have a google button.