- Home /
Facebook Canvas strange behaviors
I was charged with making a promotional game for a website on Android, standard web and the FB canvas.
The Android and standard Web exports run (more or less) flawlessly, but I'm getting strange behaviors from the Facebook Canvas.
The game uses a custom built AJAX API to communicate with the DB.
It has a login/register system, a player specific scoreboard and a global scoreboard.
And it utilizes the Facebook Unity SDK on Android and Canvas.
The login, register and get score api calls work on all platforms,
the end game post score api call works on Android and standard Web export.
But on the FB Canvas and the same Web export that works, that end game post score api call is never called.
All other api calls show up in the browser inspector.
I've experimented with the placement of the call and unfortunately came up with nothing.
No errors, exceptions or bad api calls in the inspector,...
Regarding to placement, originally I called the post score in the OnLevelWasLoaded(int id),
checking if the id parameter matched that of the game end scene, and this works for the Android and standard Web export, but that same Web export on the Canvas fails to post the score.
Next I tried placing it in the Awake() function, checking the level loaded with Application.loadedLevel but to no avail, I get the same result.
To summarize:
Android export - works
Web export - on standard page Chrome or Firefox, http or https, works
Facebook Canvas (the same Web export) - The end game score post doesn't work
I would be very grateful to everyone that helps.