$ionicFacebookAuth.login() working example


#1

Hi All, Having a tough time getting FB login to work consistently. I am running this in the Xcode simulator. Here is a code snipped and below that is all the errors. The errors end with an INTERNAL SERVER ERROR.

$ionicFacebookAuth.login()
.then(function () {
//console.log();
console.log($ionicUser.social.facebook.data);
console.log($ionicUser.social.facebook.raw_data);

    }, function (fail) {
      //fail get profile info
      console.log('ionicFacebookAuth info fail', fail);
    }
    );

Getting a big list of errors and an INTERNAL SERVER ERROR.

2016-11-24 17:28:01.549 safetypin[12558:1697728] -canOpenURL: failed for URL: “fbauth2:/” - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2016-11-24 17:28:01.558 safetypin[12558:1697728] -canOpenURL: failed for URL: “fbauth2:/” - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2016-11-24 17:28:01.564 safetypin[12558:1697728] THREAD WARNING: [‘FacebookConnectPlugin’] took ‘21.058838’ ms. Plugin should use a background thread.
2016-11-24 17:28:06.166 safetypin[12558:1697728] FB handle url: fb1362209803790578://authorize/#state=%7B%22challenge%22%3A%22ugFLmRBz8ERVbjEe2AE0oFed%252FUQ%253D%22%2C%220_auth_logger_id%22%3A%220B39E4C1-9856-4791-8BD9-9C00C4014F22%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22sfvc_auth%22%7D&granted_scopes=user_location%2Cuser_friends%2Cemail%2Ccontact_email%2Cpublic_profile&denied_scopes=&signed_request=LlztIQY0ldhNmr4-zFrx13LNMGKj77a8rWkVaauINTc.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUUNGSlYtcnJEbGk0SHNOMVFkZENLZjBkbWZMWkxfQWE4a3U3WXNFajVLX1dJdmx6SmI2T2FPb1EtOV9HNHNFbE90aEdxdmxUVVpuLWRGRHBVc1d0MTBsTXRlS05hRm5TT21Zd09DSVVlSThUWWRpRi1ULVplQmdqLVM0NzdUQVpIVXNSR1hJWE56anF6Y2FYTVBQUTZ6NmpmRVJ1TV9UX0hyRVp2N2dzbHZnTDJ6NzVRdTNjUkhjSmQzRmFHdzU5MDBzYUZ4ZWw5UUFBYlZnQWN6ZkU5TG1EM0toNl9MQW5sTEZwMWZfclQ2NFNiQTd2TUZ4M0RlZlRIV0FpNDI1aFlqTDB0cEtMWFpOM3FXNXNRVmN2a3ltUkN2U1ZsMHdqdjRRVEU1Z0hfZ0lYNE5FR2Rqc241ei1kaXNSZzR4VElQNzN5MFNHRWs5bmVReHEzQUhrMjJpa3lUSjRVeFJjb1FQaFM2ODBONnk5RXNpT3drRFJhVE5WOUYxcUhuV1daN00iLCJpc3N1ZWRfYXQiOjE0ODAwMzAwODYsInVzZXJfaWQiOiIxMDIxMTcyMDAyMjg1NjUyOCJ9&access_token=EAATW7C926PIBALy5FNqaRQKDthYwWxIVKzC1P7PBvuLmJ3IklTtNQ7WnzKdSEGI7WPFDcEckP0x4ubhvjbOIgxyx9YhQv3ZCXLs13zn0NZCR95U85ojgUebvdcyfanG4yYXFiy69zcrZAFRFG4bKg3lZCYPV3rll8Hahj368rbtXpGCcJD4U33CBsXRrzGD3bZBb3cslgUqVFArpvHtJTJ1TKj8c3WSYZD&expires_in=5174256&e2e=%7B%22init%22%3A188959.81435792%7D
2016-11-24 17:28:07.839 safetypin[12558:1697728] ionicFacebookAuth info fail Error: INTERNAL SERVER ERROR


#2

Got this working. Changed my config and removed the permissions. Taking default scope.

$ionicCloudProvider.init({
“core”: {
“app_id”: “ABC”
},
“auth”: {
“facebook”: {
“scope”: []
}
}
});