3

I am trying to test my code with

.controller('AppCtrl', function ($scope, $ionicModal,  $cordovaOauth, $localStorage, $location) {
        $scope.login = function() {
            $cordovaOauth.facebook("APPID", ["email", "read_stream", "user_website", "user_location", "user_relationships"]).then(function(result) {
                $localStorage.accessToken = result.access_token;
                 alert("facebook login correctly");
                $location.path("/profile");
            }, function(error) {
                alert(error);
                console.log(error);
            });
        };

But all the time getting error:

cannot authenticate via a web browser

I am using ionic and cordovaOauth, when I am trying to test the app with android I don't get any response.The question is how can I debug it really with simulator or something easily like PhoneGap app, I tried to work with phone gap but can't know how can I debug it.

Vitaly Menchikovsky
  • 7,684
  • 17
  • 57
  • 89
  • 1
    Debug Cordova iOS app: http://stackoverflow.com/questions/14506160/how-can-i-debug-js-code-using-cordova-and-ios-simulator Debug Cordova Android app: http://stackoverflow.com/questions/21332853/is-there-a-real-solution-to-debug-cordova-apps – manzapanza Apr 09 '15 at 12:16

1 Answers1

5

I've met the same problem and I have found this : https://github.com/nraboy/ng-cordova-oauth/issues/46

Basically, you should test your code in an emulator not in a browser.

benek
  • 2,088
  • 2
  • 26
  • 38