Oauth.io phonegap social login (cannot find hostname in file: ///)

I have included the oauth.js file. I initialize oauth using the following code

OAuth.initialize('public-key');
OAuth.popup('twitter', function(error, result) {
                console.log(result);
                //handle error with error
                //use result.access_token in your API request
                result.get('/1.1/account/verify_credentials.json').done(function(data) {
                    console.log(data)
                    alert('Hello ' + data.name)
                })
            });

Actually it works in the browser, but not in the device.

I tried to include the following plugin in config.xml

<gap:plugin name="OAuth.io" value="com.phonegap.plugins.oauthio" version="0.1.1"/>

But I get the message "this plugin is not supported for telephony" during build creation in [https://build.phonegap.com/][1].

So, I uninstalled this plugin and created the .apk file and executed it on the device. Its getting the next error that is mentioned in the screenshot.

enter image description here

Please help me. Thank.

+2
source share
2 answers

Have you checked this? https://github.com/oauth-io/oauth-phonegap/issues/11

, . - OAuth.getVersion() , , ( -).

0

1) oauthio js html ( )

2) , phonegap.js cordova.js .

3) , oauthio , .

document.addEventListener('deviceready', function() {OAuth.initialize('app_id');}, false)

0

All Articles