问题
I follow the official documentation of the plugin: cordova-plugin-facebook4 and the only thing I have to do is get the id of my application and the name fromfacebook developers:
and execute the command:
cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID = "380 ....." --variable APP_NAME = "TI...."
for android I have this configuration:
I managed to get the key hash and it works. but for it to work I had to edit this file:
platforms\android\app\src\main\res\values\strings.xml
and I added these lines (If I do not add these lines, it does not work):
<string name = "fb_app_id">380...</ string>
<string name = "fb_app_name">TI...</ string>
it works like this:, any user can authenticate by facebook, but strangely am, I was the developer, I asked for the key hash generated, if I do not add it, it allows authenticating any user except me, therefore I added thekey hash . (But I do not care because it works for me)
So I have the configuration for ios:
To try to prove it I am using a virtual machine of mac and usexcode to compile and test my application, but when I try to click on the authentication button on Facebook, the web browser opens with a facebook web page (I do not have the app), with this error:
in english:
the identifier of the application is not valid. the indicated identifier does not look like a valid application identifier
in Android I do the same procedure, I do not have the facebook app and the web browser is loaded with facebook, I authenticate and redirects to my app once authenticated. in IOs it does not work.
this is shown by the XCODE console:
What I can do? this is my config.xml
回答1:
See the Android Guide of the plugin https://github.com/jeduan/cordova-plugin-facebook4/blob/master/docs/android/README.md chapter cordova-android >= 7
According the screenshot of your config, the configuration for your cordova-android 7 is missing
<config-file parent="/resources" target="./res/values/strings.xml">
<string name="fb_app_id">123456789</string>
<string name="fb_app_name">myApplication</string>
</config-file>
来源:https://stackoverflow.com/questions/50828673/i-can-not-authenticate-myapp-with-facebook-from-ios