Getting ionicFacebookAuth to work



I am trying to get Facebook login working. I think I am almost there but must be missing a step.

I have a link to #/app/facebook to start the process

Inside app.js I have:

.state('app.facebook', {
	url: "/facebook",
  	views: {
		'menuContent': {			
	 		controller: 'facebook'

Within app.js I also have …

angular.module('starter', ['ionic', 'starter.controllers', ''])

And …

.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider, $ionicCloudProvider) {

	  "core": {
	    "app_id": "my-facebook-app-id-is-here"
	  "auth": {
	    "facebook": {
	      "scope": ["email", "public_profile"]

When I click the link I am taken to Facebook, I see my logo, I am asked to confirm that I want to proceed. I click OK.

I am returned back to my app and I see an alert saying … “FAIL: Error: BAD REQUEST”

Inside my controller.js file I have:

.controller('facebook', function($location, $scope, $ionicFacebookAuth, $ionicUser) {

		.then(function () {
			$scope.userData = $;
	    },function (fail) {
			alert("FAIL: " + fail);	    
			$scope.userData = $;	      

I have followed the instructions on for setting up the app and have as the OAuth redirect URI.

Can anybody give me any tips?

Thank you :slight_smile:


Did you ever solve this I am having the same issue.
It fails sileintly and my console.log(“good”) never fires.


I gave up using the Ionic Package tool. Instead I run “ionic build ios”, open it in Xcode and then put it onto my phone. The Facebook integration then seems to work well.