Closed subsoap closed 6 years ago
I am not sure that I understand where is the bug. How it looks like for me on android: https://youtu.be/xcCja9jQn6c
What Android version are you testing on?
I tested on 7.0 @britzl was able to reproduce it
Android 6.0 Xiaomi redmi note4 Can you try using this link: https://www.facebook.com/instantgames/285409181956230/ ?
That seems to load properly on Chrome and Android so it must be something different you are doing vs the template html included in the fbinstant extension. Could you check the fbinstant extension bundled version and see where the error is compared to your version?
I'm checking this now too.
Could you post your .html template?
You should test the XOXO example on your phone too to see if it loads properly or not like your card game does.
yes, of course. I made my own template (didn't use xoxo template) For example in my template I use early FBInstant init.
Yes, xoxo game loads 0-100% instantly
I tested your template and it seemed to make loading work, so need to find what's wrong with the fbinstant extension built in html to make it not work on Android (it works on iOS)
Maybe the reason is early initialization of SDK ? FBInstant.initializeAsync().then(function() {...})
I'll test that
Seems like it could be that, doing more testing.
This is one of the Best Practice recommendation : Load resources in parallel with initializeAsync https://developers.facebook.com/docs/games/instant-games/best-practices
I save is_already_init variable when loading into Module._instant_inited
FBInstant.initializeAsync().then(function() {
Module._instant_inited = 1;
})
Then checking is_already_init in lua:
function M.init(callback)
if tonumber(html5.run("Module._instant_inited")) == 1 then
callback()
else
fbinstant.initialize(function(self, success)
callback()
end)
end
end
I tested the change and it worked on Chrome and Android for me. So template html should be changed likewise in some way @britzl to follow @AGulev 's way of checking for init
app_container.style.width = width+"px";
app_container.style.height = height+"px";
game_canvas.width = width*dpi;
game_canvas.height = height*dpi;
window.console.log("width: " + game_canvas.width + " > "+ game_canvas.style.width)
window.console.log("height:" + game_canvas.height + " > "+ game_canvas.style.height)
}
FBInstant.initializeAsync().then(function() {
Module._instant_inited = 1;
});
resize_game_canvas();
window.addEventListener('resize', resize_game_canvas, false);
window.addEventListener('orientationchange', resize_game_canvas, false);
</script>
@britzl I did some more tests for this, I'll submit a pr soon with changes to the api tester and xoxo example.
Also happens in Chrome so may be easier to debug there.
Other non-Defold based games on Android show loading progress. Loading progress of Defold based games does work on iOS.