Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 1.29 KB

README.md

File metadata and controls

66 lines (53 loc) · 1.29 KB

GateKeeper

AccountManager simplified. Initialize GateKeeper

 val gateKeeper = GateKeeper(context)

Save user credentials

  gateKeeper.enter(accountName: String, authToken: String) 

Clear saved user credentials

  gateKeeper.logout()

Usage

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>

Optional - For supporting multiple app installs

    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
    }
}