Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Using SDK

Bernat Borrás Paronella edited this page Feb 6, 2016 · 3 revisions

The SDK needs a Token and url in order to make Github requests.

TokenProvider.setTokenProviderInstance(new TokenProviderInterface() {
  @Override
  public String getToken() {
    return "your user token";
  }
});

Personal token

  • Create a new token here
    • Check repo, user, and notifications scopes
  • Copy the generated token
  • Use it in TokenProvider implementation.

Users tokens

  • Authenticate your users whenever you want
    • This SDK provides some OAuth helpers
  • Saves your new user token somewhere (cloud, preference, post-it, ...)
  • Provides TokenProvider with correct token for user who uses the app

You can encrypt, save it anywhere, or get it from network request, but the responses of getToken() has to be plain text wit the token.

##URL

UrlProvider.setUrlProviderInstance(new UrlProviderInterface() {
  @Override
  public String getUrl() {
    return "https://api.github.com";
  }
});

If you use Github Enterprise you should provide your own server api endpoint

Clone this wiki locally