2

I need to port a Phonegap App from 2.3 to 3.5 .

I created a new clean project using Phonegap 3.5 . Added iOS platform and added the plugins. I added the Phonegap Facebook Plugin as indicated in the Plugin Page :

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

The plugin added itself ok, or at least that's what it seems. When I opened the project in XCode, it doesn't build, it reports a Lexical or Preprocessor error that it cannot find file FacebookSDK/FacebookSDK.h .

Any help will be appreciated. Thanks.

EDIT:

I made the error go away but I am not sure if what I did is correct.

Under Frameworks, all frameworks have Headers folder with the .h files. In the case of the FacebookSDK.framework, Headers was a file with a path to a folder ./Versions/A/Headers . I manually copied the content of Versions/A folder under the FacebookSDK.framework folder. Now it finds the FacebookSDK.h file.

Vero
  • 1,742
  • 3
  • 15
  • 29
  • Take a look at http://stackoverflow.com/questions/12849209/how-to-make-xcode-find-file-facebooksdk-h and http://stackoverflow.com/questions/20065666/lexical-or-preprocessor-issue-facebooksdk-facebooksdk-h-file-not-found – Regent Jul 14 '14 at 03:50
  • Thank you. Those solutions did not work. – Vero Jul 14 '14 at 14:02

1 Answers1

0

I installed the phonegap plugin facebook through a locally cloned copy and also re-add the FacebookSDK.framework to Xcode after installation, but none of this worked to me. The way I solved was installing https://github.com/jeduan/cordova-plugin-facebook4.

  1. Remove the phonegap plugin: ionic plugin rm phonegap-facebook-plugin

  2. Clone the next plugin git clone: https://github.com/jeduan/cordova-plugin-facebook4.git

  3. Add the plugin manually: cordova -d plugin add PATH/cordova-plugin-facebook4 --variable APP_ID="*****" --variable APP_NAME="*****"

Thats how it works to me.

Kimy BF
  • 1,029
  • 3
  • 13
  • 23