Skip to content
/ Loglr Public

A project to enable 'Login using Tumblr' a breeze.

License

Notifications You must be signed in to change notification settings

ArcherN9/Loglr

Repository files navigation

Download Android Arsenal

Loglr

So happy to inform this library has been ported to Kotlin!

The easiest way to get your user logged in via Tumblr

Loglr is library that enables developers to implement 'Login via Tumblr' with as minimum frustration as possible.

Note : The library is in active development. On and off, one may encounter bugs or mistakes. Please report them on the issue tracker.

Download the demo application from the PlayStore!

Get it on Google Play

Importing to your project

Gradle :

    implementation 'com.daksh:loglr:2.1.4'

Usage

Loglr uses singleton pattern and accepts a minimum of 5 parameters to complete the login process. Each method that accepts a parameter returns the Loglr Instance to avoid boiler plate code. Retrieve the Loglr instance and set up the Consumer Key and Consumer Secret Key received from Tumblr apps dashboard. You get these when you set up a new app.

    Loglr.
        //Set your application consumer key from Tumblr
        .setConsumerKey("ENTER CONSUMER KEY HERE")
     
        //Set your application Secret consumer key from Tumblr
        .setConsumerSecretKey("ENTER CONSUMER SECRET KEY")

Up next, you need to pass an interface that will be called when Login succeeds.

        //Implement interface to receive Token and Secret Token
        .setLoginListener(loginListener) 

In case login fails and exceptions are thrown, an exception handler interface needs to be passed so you may ascertain reasons for failure.

        //Interface to receive call backs when things go wrong
        .setExceptionHandler(exceptionHandler)

Amongst the most important parameters, is the URL callback method. Post login, Tumblr redirects the authenticating user to the callback URL set up on Tumblr Apps dashboard. When the URL is received by Loglr, further login procedure is carried out. If no URL is provided, the login shall fail.

        //The URL callback needs to be same as the one entered on the Tumblr Apps Dashboard
        .setUrlCallBack(strUrlCallback)