I am using AWS amplify to build the backend of my ios application. I am having an issue initializing appsync client. I have added Auth to the backend and have signed in but I am getting the following error in the console:
CONSOLE:
Error initializing appsync client. invalidAuthConfiguration("AWSCognitoUserPoolsAuthProvider cannot be nil.")
In AppDelegate:
// CONFIGURE AWSAppSync
do {
// You can choose your database location if you wish, or use the default
let cacheConfiguration = try AWSAppSyncCacheConfiguration()
// AppSync configuration & client initialization
let appSyncConfig = try AWSAppSyncClientConfiguration(appSyncServiceConfig: AWSAppSyncServiceConfig(), cacheConfiguration: cacheConfiguration)
appSyncClient = try AWSAppSyncClient(appSyncConfig: appSyncConfig)
print("appSyncClient initialise success \n")
} catch {
print("Error initializing appsync client. \(error)")
}
I am just guessing here but 'appSyncConfig' variable should be:
let appSyncConfig = try AWSAppSyncClientConfiguration(appSyncServiceConfig: AWSAppSyncServiceConfig.init(), cacheConfiguration: cacheConfiguration, userPoolsAuthProvider: AWSCognitoUserPoolsAuthProvider?)
But how do i get AWSCognitoUserPoolsAuthProvider????