Build for Facebook Instant Games

Hello!
I am trying to use Armory as engine for Facebook Instant Games. Unfortunately i have encountered problems with integration and i don’t have programming skills to resolve it by myself.
From Facebook Instant Games documentation
https://developers.facebook.com/docs/games/instant-games/getting-started/quickstart
I found that i have to write this in index.html
<script src=“https://connect.facebook.net/en_US/fbinstant.6.2.js”></script>

And that was easy. But next i should add

FBInstant.initializeAsync().then(function() {
FBInstant.setLoadingProgress(100);
FBInstant.startGameAsync().then(function() {

instead default onload function of my game
I can’t find were it is, and how it works.

Can can anyone help me?

hey, writing Facebook games should be written from scratch to allow achievements etc…
perhaps if a porting company can help you port the game to Facebook, it’ll be easier.

Thanks for advise. I’ll think about that.
I saw a 2DKIT engine, based on Haxe, which can easily export games on FIG.
http://2dkit.com/
And also i have found Haxe externs for Facebook Instant Games SDK.


So i thought it will be not so difficult. But i can’t understand how it works by myself.