kios1
May 30, 2019, 4:09am
1
Hi Defold Team and Community,
Thanks for fixing the Facebook Extension Crash with the DefUnityAds Libabry. This community is really amazing.
However, after testing the latest update of the Defold version for several days, I still find some problems caused by the new facebook extension:
Facebook SDK is not updated to the latest version
Facebook SDK is not compatible with the HTML5 build
Is there any advice from the community? Thanks in advance.
Next step is to update the extension to use the latest version of the Facebook SDK. @Mathias_Westerdahl is working on this.
Do you get this error on startup or after calling some function?
2 Likes
kios1
May 30, 2019, 7:07am
3
Nope, I just fetch the library and build the HTML5 bundle and the error pop out.
When I remove the packages, the error resolved itself. So maybe it’s probably the error from facebook extension ?
It’s working well for me using the latest version of the editor and extension (v 1.3)
1 Like
kios1
May 30, 2019, 7:49am
6
My Defold Editor version is v1.2.155 and the Facebook Extension is v1.3 (Master)
But Unfortunately, I still experience an error for the HTML5 Build. Can I just exclude the facebook library when I build for HTML5 Only ?
Here’s the error console on Safari Browser. (The previous I post is on Chrome)
kios1
May 30, 2019, 7:53am
7
Is it the error from the index.html template ?
Which one should I use ?
You should use the first one (from builtins
folder), the second one should be merged into your template automatically using Merging tool.
2 Likes
kios1
May 30, 2019, 8:28am
9
I try to build with the script in builtins folder, but I got the following errors again :
However, I can solve the problem by customizing the html template as follow :
<body>
<div id="fb-root" class="fb-root"></div>
<div id="app-container" class="canvas-app-container">
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="720" height="1280"></canvas>
</div>
<script type='text/javascript' src="dmloader.js"></script>
<script id="engine-start" type="text/javascript" merge="keep">
// Load Facebook API
var fb = document.createElement('script');
fb.type = 'text/javascript';
fb.src = '//connect.facebook.net/en_US/sdk.js';
//fb.onload = load_engine;
document.head.appendChild(fb);
</script>
<script type='text/javascript'>
var extra_params = {
archive_location_filter: function( path ) {
return ("archive" + path + "");
},
engine_arguments: [],
splash_image: "splash_image.png",
custom_heap_size: 268435456,
disable_context_menu: true
}
Module['onRuntimeInitialized'] = function() {
Module.runApp("canvas", extra_params);
};
Module["locateFile"] = function(path, scriptDirectory)
{
// dmengine*.wasm is hardcoded in the built JS loader for WASM,
// we need to replace it here with the correct project name.
if (path == "dmengine.wasm" || path == "dmengine_release.wasm" || path == "dmengine_headless.wasm") {
path = "WeatherChange.wasm";
}
return scriptDirectory + path;
};
function load_engine() {
var engineJS = document.createElement('script');
engineJS.type = 'text/javascript';
if (Module['isWASMSupported']) {
engineJS.src = 'WeatherChange_wasm.js';
} else {
engineJS.src = 'WeatherChange_asmjs.js';
}
document.head.appendChild(engineJS);
}
load_engine();
</script>
</body>
Does anybody know the reason behind ?
This sounds strange.
Can you post the index.html from a nonworking build?
It might be that the merging fails for some reason. What platform are you on?
EDIT:
Can you also try with the extension itself as a project?
1 Like