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
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
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?
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
replaced “localStorage” with “cc.sys.localStorage” and several fixes.
Usage:
//Require at the beginning of your component script
require("gameanalytics"); // defines window.ga for global usage
// then you can use like this:
ga.GameAnalytics.setEnabledInfoLog(true);
ga.GameAnalytics.initialize("...", "...");
ga.GameAnalytics.addProgressionEvent(ga.EGAProgressionStatus.Start, "World01", "Level01","Section01");
...
// you can check any time if it initialized correctly
if ( ga.GameAnalytics.isSdkReady(true, false) ){
// do whatever you want
}
...
// For example you can put these lines into onLoad function of your component:
// Game goes background
cc.game.on(cc.game.EVENT_HIDE, function () {
ga.GameAnalytics.endSessionImmediate(); // End session
}.bind(this));
// Game comes foreground
cc.game.on(cc.game.EVENT_SHOW, function () {
ga.GameAnalytics.startSession(); // Start session
}.bind(this))
I made game with cocos creator. And I want to build for IOS. So I bring game project on mac cocos creator engine and compile on simulator. And then Error occurred:
Simulator: Received signal 11 SEGV_MAPERR 0000000002f0
Why I should get it?
After it, I Build that. But I can do nothing.
I try build project in Xcode and then it can’t play on my iPad.
How do it?
I look forward your reply.
Thank you.