fbDidLogin not firing when called from C++ on iPhone app
-
11-12-2019 - |
Question
I have an app on iOS that works with C++ (a Cocos2DX game). I want to integrate Facebook on it.
I initialize the Facebook iOS SDK as the Facebook developers website indicates it, on a Objective C class. Then I call this Objective-C class from my C++ code, and it seems to work -the Facebook app is opened and asks for authentication and permissions-.
The problem is that the "events" or "callbacks" like fbDidLogin are not called back, or at least I do not have control over them from C++
Do you know if that can be done?
Thks.
Solution
Ok, the solution:
All the Facebook related code must be in the AppDelegate.m Then you can access it from anywhere in your code with this instruction:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate FacebookLogin];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow