AccountManager simplified. Initialize GateKeeper
val gateKeeper = GateKeeper(context)
gateKeeper.enter(accountName: String, authToken: String)
gateKeeper.logout()
root build.gradle
allprojects {
repositories {
//...
maven { url 'https://jitpack.io' }
}
}
app build.gradle
dependencies{
implementation 'com.github.jecsan:gatekeeper:1.0.5'
}
In your strings.xml, add the following string:
<string name="account_type">your_app_name</string>
debug{
....
resValue "string", "account_type", "debug_account_type_here"
}
release{
....
resValue "string", "account_type", "release_account_type_here"
}
In your Application class, implement the Gate class and provide the activity that you will use for authentication/login.
class SampleApp : Application(), Gate {
override fun getGateClass(): Class<*> {
return LoginActivity::class.java
}
}