Gamua/Flox-ObjC

Working with latest Flox server?

Closed this issue · 10 comments

Hi, finally got a chance to test this Obj-C version of the flox client. Was wondering when the last time you confirmed this was working as expected?
I can compile the client and run it in an app no problem. Most of the unit tests also seem to work (except for three query ones).

It seems the initial start works as I can see results of users, sessions and version info on the flox website, however it seems that every launch ends up being a totally new user (no concept of a persisted installationID getting used for subsequent launches from the same device/app.
Inspecting the local flox/queue and flox/store folders always seems to be empty of any content.
Also, none of the custom events I send end up in the stats, nor do I see any log files.

I'm happy to implement new code in the Obj-C port if I need to by looking at the AS3 client but maybe you have an immediate idea of what I should try debugging for failure points?

I'm testing the Obj-C client with the app:
https://www.flox.cc/panel/games/kUyutBId52lJ5e7a/analytics/totals

Thanks,
Jeff

Hi Jeff!
As you might have guessed by the little activity in this repository, the responses to the Obj-C variant of the library were not exactly overwhelming, so I must admit I haven't looked into it for a while. But I'll do that right away! The library should be fully functional — I'll reply here as soon as I know what the problem is.

Ok cool thanks! Yea I was hoping you might have had a few active Sparrow apps on it.My short term needs is just to be able to save custom events and keep sessions and returning users active with working offline logs. No use of players, entities or queries if that makes it less to have to worry about looking at.

So, now I was able to make an in-depth check about this.

That the unit tests failed was actually an error in the unit tests. I recently added new unit tests to the AS3 version, and the entities I created here came up in the Objective-C tests (both tests share the same game id). So I had to modify the Objective-C tests to be able to cope with the new entities.

Beside that, everything should be working just fine, though! With one caveat: if you test this and hit the "stop" button in Xcode or simply shut down the simulator, the local data won't be saved to the disk. You have to click on the home button for this to happen — or call [Flox saveLocalData] manually whenever you want.

That's probably the reason why nothing showed up on the server in your tests, besides the data that is sent right at the beginning. I made some tests with your game ID and you should see the logs and events that I submitted.

While I was at it, I updated the project for the latest Xcode version and removed the requirement of the "ObjC" and "all_load" preprocessor flags.

Could you try the latest version and use it like described above (with the home button)? Thanks in advance!

Thanks Daniel! Appreciate you looking at this so fast.
Very interesting that you were able to see events and yes I see your test event.
I was actually taking the Flox sources and building it into my own static library that I am adding to multiple apps. Maybe I am running into issues with that style (though I got no runtime errors).
I did see your recent update with removing ObjC and all_load change and tried using the single object linker mode on my static lib with the combined Flox sources but couldn't get it to build.
I pull your latest sources and try again and let you know, thanks!

I don't see any reason why this shouldn't work with a static library, just as well ... hm ... to be sure, you could add some log output to the "saveLocalData" method, or to one of the methods that it calls internally.

I'm also thinking about making one "saveLocalData" call right at the beginning, when everything is set up, so that a crashing app at least shows up as only one installation.

... and that's just what I did. Now, if you log out [FXPlayer current].id, you should always get the same one, even if you quit the app with Xcode. (Until you log in a different player, of course.)

Let me know if that works for you, and if you need any more help.

So I just tried the latest code and really what looks like only a header addition, you can see I am getting my custom Events to now show up in that tester app. Don't see my logs from the US yet (though I guess there might be a delay), and not sure if my user is returning with multiple sessions, but I will test that. Interesting was that I was previously getting the '[Info] Game deactivated' log so I think saveLocalData should have been getting called before... But it looks like things might be working here now once I confirm I am getting the same user returning on relaunches. Thanks again!

Just saw my logs from the US showing up :)

Just confirmed that my sessions are getting linked to one user now too. Kind of bizarre it is all working now when I wasn't seeing this before. Sorry I doubted your awesomeness that the ObjC port needed work :)

I'm happy to hear that it works now! Thanks for trying it out! :-)
Let me know if anything pops up.