WebGL Facebook game - Application.ExternalCall(...) and gameInstance.SendMessage(...) don't work

So I’ve got a WebGL game that I’m trying to get running on facebook.

I’ve got everything to work fine as a vanilla WebGL game running from my own server, but as soon as I try the same in a Facebook iframe parameter passing between Unity (Applicaiton.ExternalCall) fails.

For example, my game will call: Application.ExternalCall(“doExternalEvent”, 1, 2, 3)

The external call works perfectly well on vanilla WebGL, but when built for facebook and displayed in their iframe, all parameters (1,2,3) are always 0 (or perhaps not set so are showing as 0 - I’m no expert with JS).

I’m also finding that when the external event finishes I call back to Unity from HTML/JS using gameInstance.SendMessage(“myObject”, “myMethod”, “myParam”);

But this send message call never get through on the Facebook iframe instance, but again works perfect with vanilla WebGL on my own server…

I assume this is some kind of Facebook iframe sandboxing/crippling/etc - but others have got this to work, so it must be doable some how.

What am I missing?

Bump.

Can any Unity staff help out here? I’d have thought Unity staff would know how to integrate these elements into a Facebook game, especially since they support targeting Facebook.

Surely someone here knows how to do this?

Bump.

Please Unity staff, we could do with some assistance here…

How are we devs supposed to monitize a facebook game if we can’t show ads?

Our entire product release is held up with this one issue that we simply can not release without.

Anything, hints, ideas, would be great.

Hey! Did you submit a bug?
Would be nice to have a sample project, so we can fix it fast

Hey, I solved this today but the solution abandoned using the deprecated Application.ExternalCall() methods.

I’ve got the .jslib method working now.