jeduan / cordova-plugin-facebook4

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
765 stars 510 forks source link

User cancelled on facebookConnectPlugin.login on iOS #820

Closed Adrian-GP closed 4 years ago

Adrian-GP commented 4 years ago

Facebook login was working fine for both Android and iOS like 2 weeks ago, but for some reason lately on iOS it has been crashing, whenever someone from iOS tries to login it sends out the error of: "User cancelled"

I tried to fix it by updating the plugin, however the error persists. I do not think there's something wrong with my code since Android still works and iOS used to work, and I've not changed anything from the login code.

Has Facebook SDK changed something that broke the iOS login or something?

Anyone else having these issues?

I just checked and after removing ang re-adding the plugin, the version did not get updated when running npm outdated.

How do you update the plugin?

Adrian-GP commented 4 years ago

Edit: I get the following error when adding the ios platform after updating succesfully the facebook4 plugin.

Running command: pod install --verbose Failed to install 'cordova-plugin-facebook4': Error: pod: Command failed with exit code 31 at ChildProcess.whenDone (/Users/sofex/Documents/Sofex/SissaUserFront/cordova/node_modules/cordova-common/src/superspawn.js:135:23) at ChildProcess.emit (events.js:198:13) at maybeClose (internal/child_process.js:982:16) at Socket.stream.socket.on (internal/child_process.js:389:11) at Socket.emit (events.js:198:13) at Pipe._handle.close (net.js:606:12)

peterpeterparker commented 4 years ago

Well Fb SDK release notes are kind of black boxes and don't tell much see iOS and Android

Are you sure you face the problem with Facebook and note Google? "User Cancelled" is a typical error linked with that last method

Regarding your installation error, plz be sure that you followed all the steps regarding Cocoapods in the documentation

Good luck

boost-app commented 4 years ago

I'm facing exactly the same issue. Android is working fine and iOS Facebook-Login performed the usual self-destruction...

"User canceled" error thrown immediately after invoking the login method.

peterpeterparker commented 4 years ago

Plz provide sample repo

boost-app commented 4 years ago

Ok i created a demo project and in the end the creation itself fixed the problem in the main project :D

In the end i did the full circle:

(i noticed, that i was running
"cordova-plugin-facebook4": "4.2.1" vs. "cordova-plugin-facebook4": "^6.2.0" now so the update was overdue)

emilio-ferrer commented 4 years ago

@teamgeist-app I have the same issue. Any solution ?

peterpeterparker commented 4 years ago

@teamgeist-app thx for the analysis and cool to hear you solved it!

so it looks like it isn't related to the plugin itself, therefore I close this one. if anyone face the error and is able to reproduce it in a clean demo project, ping me, will then open the issue back again.

Adrian-GP commented 4 years ago

I managed to fix it. Steps to do so:

Anish-ichigo commented 4 years ago

I am facing this issue for ionic 3 platform, I don't want to make it in ionic 4. So can you please tell me that above mention solution is appropriate for ionic 3 app?

emilio-ferrer commented 4 years ago

@Anish-ichigo @Adrian-GP 's answer was a solution for me for ionic 3

boost-app commented 4 years ago

Ok i created a demo project and in the end the creation itself fixed the problem in the main project :D

In the end i did the full circle:

  • remove plugin from project
  • (in case of ionic) update npm ionic-native module
  • update cocoapods, rubygems and all involved parties...
  • 'pod update' inside platforms/ios
  • install plugin again fixed...

(i noticed, that i was running "cordova-plugin-facebook4": "4.2.1" vs. "cordova-plugin-facebook4": "^6.2.0" now so the update was overdue)

Ionic was not involved in the fixing process, only cordova. Have you tried it?

sambauwens commented 4 years ago

I managed to fix it. Steps to do so:

  • Remove plugin
  • Remove BOTH Android and iOS platforms (cordova platform remove android // cordova platform remove ios)
  • Reinstall plugin
  • Verify that it's up to date npm outdated (I think that's the command)
  • Problem went away, the deal was to FORCE the update on the plugin, which won't happen if any of the platforms is still installed by the time you try to re-install it again.

Thanks ! installing exactly the same version of both packages by following your steps fixed it for me (didn't have to update).

What I did exactly (for my versions) :

cordova platform remove android
cordova platform remove ios
cordova plugin rm cordova-plugin-facebook4
npm uninstall @ionic-native/facebook
ionic cordova plugin add cordova-plugin-facebook4@3.2.0 --variable APP_ID="<<MYAPPID>>" --variable APP_NAME="<<MYAPPNAME>>"
npm install --save @ionic-native/facebook@4.17.0
ionic cordova platform add ios --no-resources
npm i
...