Slide 26
Slide 26 text
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:
[UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let credentialsProvider = AWSCognitoCredentialsProvider(regionType:
AWSRegionType.USEast1, identityPoolId:"your-pool-id")
let serviceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1,
credentialsProvider:credentialsProvider)
AWSServiceManager.default().defaultServiceConfiguration = serviceConfiguration
let config = AWSLexInteractionKitConfig.defaultInteractionKitConfig(withBotName:
"RecipeBot", botAlias:"Prod")
// 5000 seconds before timeout
config.noSpeechTimeoutInterval = 5000
config.maxSpeechTimeoutInterval = 5000
// We will use this key to retrieve the interaction kit in our view controller
AWSLexInteractionKit.register(with: serviceConfiguration!,
interactionKitConfiguration: config, forKey:"USEast1InteractionKit")
return true
}