How can i add gameanalytics to my IOS build?

How can i add gameanalytics to my IOS build?
0

#1

TLDR
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
https://gameanalytics.com/docs/item/cocos2d-sdk
but it says cocos creator html5


#2

Did you find a solution?


#3

Nop, i did not


#4

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?


#5

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:

https://gameanalytics.com/docs/item/ios-sdk


#6

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?


#7
  • Just open the xcode and your build project

…/build/frameworks/runtime-src/pro.ios_mac/PROJECT_NAME.xcodeproj

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

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

import <GameAnalytics/GameAnalytics.h>

  • Add another code AppController.mm 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)

http://docs.cocos.com/creator/1.9/manual/en/advanced-topics/oc-reflection.html


#8

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


#9

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