Ionic 2 Native cordova-plugin-facebook4


#1

Simply put I just cannot get this thing to work. Does anyone have a “working” example.


#2

Whats not working? What have you tried?


#3

Thanks for the response. I was finally able to get things working and will explain my mistakes and learnings here for others.

  1. My setup @Facebook had a typo in the bundleID for IOS. When I fired Facebook.login the response from Facebook was poor. It told me I was not logged in. Telling me invalid bundleID or even invalid “setup” would have been better. But that is Facebook so not much can be done I suspect.

  2. When calling Facebook.api the plugin itself can fail internally and does not propagate the error to the caller. Neither success or fail callbacks get fired.

Facebook.api(userData.authResponse.userID+"/?fields=id,email,first_name,last_name", ["email_address"])

Remove email address and all is fine. Again the plugin should have trapped any error and returned it to me. But it never calls either callback in this case.

Facebook.api(userData.authResponse.userID+"/?fields=id,email,first_name,last_name", [])

The following call is also invalid but the plugin does fire the fail callback. So the plugin does in fact have awareness for some error management, just not everything.

// There are illegal spaces in the URI
Facebook.api(userData.authResponse.userID+"/?fields=id,email,  first_name,  last_name", [])

The plugin works well when all is well but error handling is important.


#4

Hi!

Could you make POSTs to the graph Api using this plugin?
Is there any good alternative for Ionic 2 + Typescript?

Thanks