Hi devs :D, I'm trying to build a plugin for Facebook InstantGame, I used the Construct sdk to build my own, but I'm heavily stuck on the step when calling the Facebook SDK inside my runtime js, the Export always give me the error unable to run the script manifier when the option manify script is active, here is my code where I called the Facebook SDK:
typeProto.onCreate = function()
{
var that=this;
var script = document.createElement('script');
script.src = "https://connect.facebook.net/en_US/fbinstant.6.3.js";
document.getElementsByTagName('head')[0].appendChild(script);
script.onload = function() {
alert("Echopros!! Script loaded and ready");
FBInstant.initializeAsync()
.then(function() {
console.log("Echopros 1");
FBInstant.setLoadingProgress(100);
FBInstant.startGameAsync()
.then(function() {
this2.runtime.trigger(cr.plugins_.FbInstant.prototype.cnds.entrypointComplete, this2);
console.log("Echopros 2");
contextId = FBInstant.context.getID();
contextType = FBInstant.context.getType();
var playerName = FBInstant.player.getName();
var playerPic = FBInstant.player.getPhoto();
var playerId = FBInstant.player.getID();
entryPointData = FBInstant.getEntryPointData();
console.log(playerId);
console.log("Echopros 3");
console.log(entryPointData);
console.log(playerPic);
console.log("Echopros 4");
console.log(playerPic);
// Once startGameAsync() resolves it also means the loading view has
// been removed and the user can see the game viewport
game.start();
});
});
};
};