Skip to content

Instantly share code, notes, and snippets.

@anotherdev
Last active June 18, 2019 05:22
Show Gist options
  • Save anotherdev/5c8f08de49bd7929fc405c60bf9e2131 to your computer and use it in GitHub Desktop.
Save anotherdev/5c8f08de49bd7929fc405c60bf9e2131 to your computer and use it in GitHub Desktop.
Eko Login SDK Android integration
Requirements:
1. Minimum Android API 21
2. Enable Java 8
Steps:
@anotherdev
Copy link
Author

anotherdev commented May 17, 2019

Integrating Eko Login SDK to your app

  1. Create an EkoLoginClient object
EkoLoginOptions options = new EkoLoginOptions.Builder()
    .loginWithAppId("com.ekoapp.ekosdk.app.target.blue")
    .isDebug(true)
    .build();

EkoLoginClient client = EkoLoginClient.getClient(options);
  1. On login button clicked, call login() method.
Context context = <the activity context>
client.login(context)
    .subscribe(
        account -> {
            String ekoLoginToken = account.getToken();
            // You are now authenticated
        },
        e -> {
            EkoLoginError error = EkoLoginError.fromThrowable(e);
            // Show error dialog
        }
    )

@anotherdev
Copy link
Author

anotherdev commented May 31, 2019

Test Eko Login Provider app

Please download the Si vWORK Debug app: https://download.ekoapp.com/apps/siriraj-login

  1. On first login, ignore the "Updating configuration" screen and close the app.
  2. You can now test login with Eko.

Eko Login Provider app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment