Issue with Facebook plugin on iOS


I would like to use Facebook Login in my app.

I installed the Facebook plugin like this :

cordova -d plugin add /Users/your/path/here/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication"

But when i try to run ios, that fails.
So i removed ios platform, and added it again.

Usually that works for another plugin, but this time, i got this error message :

Failed to install 'com.phonegap.plugins.facebookconnect':Error: Variable(s) missing: APP_ID, APP_NAME

Indeed, it tries to install the plugin automatically but without the informations of the APP_ID and the APP_NAME, that fails.

Any help to get around this issue ?

Thank you :blush:

I found a solution.

Before launching ionic platform add ios, i edited the plugin.xml file in the facebook plugin folder :

preferences name="APP_ID"
preferences name="APP_NAME"


params name="APP_ID" value="facebook-app-id"
params name="APP_NAME" value="facebook-app-name"

Now i can run ios again.


I’m trying to run this plugin on my iOS, but it open a modal to enter the facebook email and password, but on Android it uses the Facebook app already installed in device…

I could run is correctly on iOS? It’s using the native login or asking to login on Facebook?

You should be able to open the Facebook app login on iOS. Is it now ok for you ?

Hi @sh4rky I forgot to add the URL Scheme fb[my_app_id], now it’s working fine. Thanks :slight_smile:

@sh4rky about your first question, you need to clone the plugin repository because of a bug with cordova.

Here is some explanation

Clone the repository, and install the plugin locally and the variables will work fine.

I was looking for the same answer and have found this app which is made with Ionic and a cordova facebook plugin and offers a native Facebook login and other Facebook options such as share links and photos and send messages to your friends. It worked fine for me and includes a great guide on how to integrate the facebook plugin to your existing app.
You can check it in the following link:

Hope it helps!