title: Facebook login on phonegap app
body: <p>I have my cordova/ionic based app that I`m building using phonegap online service.
  However I cant run the facebook login.everything works nicely on browser but on a real device none of the callbacks are executed.
  Also I noticed that window.cordova.plugins is undefined so I assume i am doing something wrong.
  I tried installing numerous plugins, and c/p random "solutions".</p>
  
  <pre><code>.controller('LoginController', function($scope, $stateParams, ngFB) {
      debugger;
      console.log('here');
      ngFB.login({scope: 'email'}).then(
              function(response) {
          debugger;
          if (response.status === 'connected') {
              ngFB.api({
                      path: '/me',
                      params: {fields: 'email'}
              }).then(
                      function (user) {
                  debugger;
                  console.log(user);
              },
              function (error) {
                  alert('Facebook error: ' + error.error_description);
              });
          } else {
              alert('Facebook login failed');
          }
      },
      function(error){
          debugger;
      }
      );
  });
  </code></pre>
  
  <p>Here is a snippet of my code, and here is my whole project - 
  <a href="https://github.com/nikksan/ecivic" rel="nofollow noreferrer">GitHub</a></p>