ngCordovaOauth and twitter problem


Hi I’m developing an app to authenticate users using twitter. The facebook authentication works fine but when the twitter section is called I get the following error.

TypeError: Object #<e> has no method 'success'
at Object.d [as twitter] (file:///android_asset/www/lib/ng-cordova-oauth/dist/ng-cordova-oauth.min.js:4:11050)
at Object.login (file:///android_asset/www/js/services.js:140:27)
at m.scopeLogin [as login] (file:///android_asset/www/js/controllers.js:183:14)
at fn (eval at <anonymous> (, <anonymous>:4:302)
at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:65429:9
at m.$eval (
at m.$apply (
at HTMLButtonElement.<anonymous> (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:65428:13)
at cg (
at HTMLButtonElement.d ( angular.js:14328

My Code is,

var res;
        $cordovaOauth.facebook("xxxxxxxx", ["email"]).then(function(result) {               
            console.log("Response Object -> " + JSON.stringify(result));
            credential = firebase.auth.FacebookAuthProvider.credential(result.access_token);
            res = auth.$signInWithCredential(credential);
        }, function(error) {
            console.log("Error -> " + error);
            //res = auth.$signInWithCredential("ewrdfwer");
       else if(provider==="twitter"){
        $cordovaOauth.twitter("xxxxxxxx","xxxxxxxx").then(function(result) {               
             credential = firebase.auth.TwitterAuthProvider.credential(result.access_token);
             res = auth.$signInWithCredential(credential);
            console.log("Error -> " + error);


I have added the jsSha(1.6) sha1.js file and have set the callback url to http://localhost/callback
*I’m using firebase 3 and angularfire2 in order to connect to firebase as well.

Please help…


To have a chance you should provide links for the libraries you are using. Is see Twitter, Firebase, Angularfire, Facebook…


I’m using Nic Raboys’ ng-cordova-oauth library

Firebase 3.9.0

Angularfire 2.3.0