Facebook login in iOS doesn't work


#1

Hi all,
I have purchased the “IonSocialApp - Ionic Social Template” in order to run Facebook login in iOS, but the “sign in with Facebook” button that actually triggers the facebookSignIn function does nothing.
However, the same cordova www code works great in Android.

I have read a thread here: https://github.com/jeduan/cordova-plugin-facebook4/issues/325
as well as the troubleshooting in the Jeduan page in Github but cannot find any solution

So, I am trying to summarize what I already did:

cd cordova-plugin-facebook4/src/ios/
curl -o FacebookSDKs-iOS-4.17.0.zip  https://origincache.facebook.com/developers/resources/?id=FacebookSDKs-iOS-4.17.0.zip
unzip -o FacebookSDKs-iOS-4.17.0.zip

Still nothing. When I press the facebook Login button, nothing happens.
Could you please help me on this?

Many thanks in advance


#2

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Safari dev tools: https://ionic.zone/debug/remote-debug-your-app#ios Look at the console and network tabs for errors.

Also: Did you ask the people you bought the template from?


#3

Great thanks!
Actually the debug mentions “Refused to load gap://ready because it appears in neither the child-src directive nor the default-src directive of the Content Security Policy.” when trying to push the facebook login button.

But I solved it by editing the “Content-Security-Policy” meta tag.


#4

Can you show us which value of the meta tag solved it?


#5

in my index.html in the www, I modified the “Content-Security-Policy” meta tag to the following. As I searched to the forums, the previous policy was too strict.

<meta http-equiv="Content-Security-Policy" content="
                        default-src * data: blob: ws: wss: gap://ready file://*;
                        style-src * 'unsafe-inline';
                        script-src * 'unsafe-inline' 'unsafe-eval';
                        connect-src * ws: wss:;">