PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Facebook on iPhone

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 !
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.
Thanks for the answer !