An Android Library used to Sign in Google, Facebook
Super Simple, Super easy to use!
Using Gradle
Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.rohjk:SimplePlatform:1.1'
}
- In Activity :
set Google OAuth 2.0 'Web Client ID', Facebook 'App ID'
SimpleSession.setAuthProvider(IdpType.GOOGLE,"<OAuth 2.0 Web Client ID>");
SimpleSession.setAuthProvider(IdpType.FACEBOOK,"<App ID>");
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
SimpleSession.onActivityResult(requestCode,resultCode,data);
}
SimpleSession.login(this, IdpType.FACEBOOK, new SimpleAuthResultCallback<Void>() {
@Override
public void onResult(SimpleAuthResult<Void> result) {
if(result.isSuccess()){
//Success to Login!
}else{
//Fail to Login!
int errorCode = result.getErrorCode();
String errorMessage = result.getErrorMessaage();
}
}
});
SimpleSession.isSignedIn(<Activity>);
SimpleSession.getCurrentIdpType();
SimpleSession.getAccessToken();
SimpleSession.getEmail();
SimpleSession.logout();