Phonegap Oauth.IO Android InAppBrowser Shows localhost after successful login

199 Views Asked by At

I am building an Android App, using Phonegap. I have included oauth.io and have configured twitter / google+ and facebook logins.

I have included : OAuth.initialize('ACTUAL PUBLIC KEY'); in the device ready event.

I have written the same function, as per sample :

function login(provider, callback) {
OAuth.popup(provider)
    .done(function(result) {
        callback(null, result);
    })
    .fail(function(error) {
        console.log(error);
        callback(error);
    });
}

When I call this function, InApp browser is opened and credentials are coming up, for each provider respectively. When the user logs in successfully, it goes to

http://localhost/#oauthio=%7B%22status%22success%22%2C%22data%22%3A%7B%22oaculDQAHRHACioXNL2BHMoFMHXQzKWZZn%22%2c

It does not come back to the Android App.

The InApp browser also does not close automatically.

As per manual, it should call back the function. Instead it is redirecting to a web page, which does not exist in Phonegap App.

Please guide.

1

There are 1 best solutions below

0
On

Removed and added the plugin. It worked. Thanks.