How can i add gameanalytics to my IOS build?

How can i add gameanalytics to my IOS build?


How can i implement Gameanalytics and facebook sdk so it works on ios?.

Long version:

My plan is to use Cocos creator so i can create games for Facebook Instant games, IOS and android.
The problem is most my clients ask for Gameanalytics and facebook sdk for testing retention and stuff.
Usually i was working with unity because the sdk is the same for IOS and android.
For cocos there is just this
but it says cocos creator html5


Did you find a solution?


Nop, i did not


Thats kind of blocker for me, I can’t use CC to develop games. Publisher needs FB and GA SDK’s, mandatory. What should I do? What you will do?


Actually it is very easy, I added FB and GA to our game for Voodoo publisher. You can follow GA Instruction and add it over xcode. It will take only 15 minutes, really :+1:


Yes that is how you add the library. But if the library is added on xcode and called using c-objetive, how do you make the event calls (game start and game end) from the js/typescript code if the lib is c-objective?

  • Just open the xcode and your build project


  • Add (drag & drop) the GA framrwork file to Frameworks folder which is located left side

  • Open “/ios/” file and call the GA library

import <GameAnalytics/GameAnalytics.h>

  • Add another code file for initiliaze the GA

[GameAnalytics setEnabledInfoLog:YES];
[GameAnalytics configureBuild:@“YOUR_BUILD_ID”];
[GameAnalytics initializeWithGameKey:@“YOUR_KEY” gameSecret:@“YOUR_SECRET”];

Actually you don’t need to call custom event in GA. You should only initialize GA and it will start to track your game. If you need custom event, you have to write object-c class/function into xcode and call it from javascript. (Javascript & Object-C reflection)


Thank you for this. It is really helpful. But if you work for voodoo you are required to record * GameAnalytics.NewProgressionEvent(GAProgressionStatus.Start, "Begin) and th end with the score, that is why i asked, but i guess that oc-reflection should work


@Andres_IC himm okay,
oc-reflection will be work for you. I’m already using for Applovin and some native functions (like vibration, etc.)