Page 1 of 1

Facebook on iPhone

PostPosted: Apr 13, 2010 @ 2:13am
by totoch
Hi,
I was wondering : if we do use another SDK for facebook connectivity (e.g. : Facebook Connect), is it possible to still program in C++ or will we have to program this specific part in Objective-C ?
One of the main reasons I chose to use EdgeLib was the possibility to still use C++ code and compile it for the iPhone.
Thanks a lot !

PostPosted: Apr 14, 2010 @ 7:28pm
by edge
Hi,

To integrate facebook in your iPhone application we recommend creating a wrapper class in c++ (and create an objective-c class inside the wrapper, handling the facebook API calls).

For example, you could create a facebookhelper class with 3 files:
facebookhelper.h (the class definition)
facebookhelper.mm (the implementation and objective-c API)
facebookhelper.cpp (an empty implementation)

You could add the .cpp file to the PC desktop project, and add the .mm file for the iPhone project. The header will be shared between the 2 implementations.

PostPosted: May 1, 2010 @ 9:23pm
by totoch
Thanks for the answer !