Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created September 11, 2018 17:29
Show Gist options
  • Save adrianhall/41ec0529e84cef8ba30148f8eefec190 to your computer and use it in GitHub Desktop.
Save adrianhall/41ec0529e84cef8ba30148f8eefec190 to your computer and use it in GitHub Desktop.
package com.amazonaws.mobile.samples.picturefeed.services.aws
import android.content.Context
import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.mobile.auth.core.IdentityManager
import com.amazonaws.mobile.auth.userpools.CognitoUserPoolsSignInProvider
import com.amazonaws.mobile.config.AWSConfiguration
class AWSService(context: Context) {
val configuration = AWSConfiguration(context)
val identityManager : IdentityManager
val credentialsProvider : AWSCredentialsProvider
init {
identityManager = IdentityManager(context, configuration)
identityManager.addSignInProvider(CognitoUserPoolsSignInProvider::class.java)
IdentityManager.setDefaultIdentityManager(identityManager)
credentialsProvider = identityManager.credentialsProvider
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment