Login Facebook, Onesignal, Unity Ads for IOS

SDKBox Shutdown Announcement.
I need login fb and onesignal. unity ads.
Cocos creator 2.4 and IOS.
Help me.

You have to implement a solution by yourself on native platforms. Then you need to use JSB to call native methods from js.
https://docs.cocos.com/creator/2.4/manual/en/advanced-topics/oc-reflection.html

So what you need step by step:

  1. Create a class with static methods in Objective-c and make the header file of the class as public.
  2. Call from the class a method to show a facebook login popup.
  3. Use this trick to send a result of login to javascript code.
Application::getInstance()->getScheduler()->performFunctionInCocosThread([=](){
    se::ScriptEngine::getInstance()->evalString(script.c_str());
});
1 Like