Facebook Instant Game loading error


#1

After the playing and exit the Facebook instance game using android messenger (load resources successfully) . When user open the Facebook instance game using messenger on android it not display game properly

this problem not occur in iPhone devices and facebook desktop site. only android

Attach a video for reference https://forum.defold.com/uploads/default/original/2X/a/ae2a857dc47c204f3b1eb4fbec2a1be19b6a1f8c.mp4


#2

It would be very valuable to get some debug output from the game. Bundle a Debug version of the game and upload it. Make sure to have the Android developer tools installed (adb specifically). Connect the Android device via USB cable and make sure that it is Developer enabled. Open a command prompt/console and run:

adb logcat -s chromium

This will show all output from chromium (the webview). It should hopefully give us some hints.


#3

dear britzl, this is the iogcat i got when running my application in messenger


#4

That log is not filtered on chromium so it doesn’t contain any relevant information as far as I can tell. You can probably make Android studio filter it, but it would be even better if you did it from a command prompt like I suggested.


#5

this is the result when use adb logcat -s chromium command


#6

Hmm, the log only shows that fbinstant.init() gets called (“FBInstant inited”) but nothing more. Can you add more print() statements on the lines after the call to fbinstant.init() and in other places of your code to try and figure out if code execution stalls on Android somehow? Is the screen completely black? What else are you doing on init? Has it never worked on Android or did it stop working now?


#7

i have put some print commands to the source code and it’s not display when app run on the messanger.
every time i tried i got following lines as result

03-18 14:55:35.248 4739 4739 I chromium: [INFO:CONSOLE(1)] “FBInstant inited”, source: https://apps-283910812292555.apps.fbsbx.com/instant-bundle/2023027271084148/2786256151392260/oombi_asmjs.js (1)

03-18 14:55:36.353 4739 4739 I chromium: [INFO:CONSOLE(0)] "Refused to frame ‘https://staticxx.facebook.com/’ because it violates the following Content Security Policy directive: “frame-src ‘self’ blob:”.

03-18 14:55:36.353 4739 4739 I chromium: ", source: https://apps-283910812292555.apps.fbsbx.com/instant-bundle/2023027271084148/2786256151392260/index.html?version=154&psev=1&gcgs=1 (0)

03-18 14:55:37.270 4739 4739 I chromium: [INFO:CONSOLE(1)] “Running…”, source: https://apps-283910812292555.apps.fbsbx.com/instant-bundle/2023027271084148/2786256151392260/dmloader.js (1)

03-18 14:55:37.314 4739 4739 I chromium: [INFO:CONSOLE(1)] “”, source: https://apps-283910812292555.apps.fbsbx.com/instant-bundle/2023027271084148/2786256151392260/dmloader.js (1)

03-18 14:55:37.581 4739 4739 I chromium: [INFO:CONSOLE(1)] “WebGL: INVALID_ENUM: getParameter: invalid parameter name”, source: https://apps-283910812292555.apps.fbsbx.com/instant-bundle/2023027271084148/2786256151392260/oombi_asmjs.js (1)

03-18 14:55:37.582 4739 4739 I chromium: [INFO:CONSOLE(1)] “WebGL: INVALID_ENUM: getParameter: invalid parameter name”, source: https://apps-283910812292555.apps.fbsbx.com/instant-bundle/2023027271084148/2786256151392260/oombi_asmjs.js (1)

03-18 14:55:37.631 10154 10169 I chromium: [INFO:audio_latency.cc(136)] audioHardwareBufferSize = 3844

According to those lines, I notice two things

Refused to frame ‘https://staticxx.facebook.com/’ because it violates the following Content Security Policy directive: “frame-src ‘self’ blob:”.

and

“WebGL: INVALID_ENUM: getParameter: invalid parameter name”, source: https://apps-283910812292555.apps.fbsbx.com/instant-bundle/2023027271084148/2786256151392260/oombi_asmjs.js

please kindly help me.

I also attached the source files
i have used collection proxy to hadle two collection.when the game start following code run’
loader.script (2.5 KB)

after fbinstant.start_game() success, the game login collection load and it contain login gui and it’s script

game login script
gamelogin.script (691 Bytes)

GUI script inti function include the following lines

print("login page gui init() start")
msg.post(".", "acquire_input_focus")
print("login page gui init() end")

you can reproduce error using messanger(android) with following link https://www.facebook.com/instantgames/283910812292555 or just search oombi in facebook messanger


#8

Are you building a debug version? If you build a release version it will remove all prints coming from your own scripts and from the extension (although not from the Javascript part of the extension).


#9

Debug version logcat,




I have tested 4 times and only one-time screen loaded correctly. please assist


#10

I don’t know where you put your print logs, but can you pinpoint where it goes wrong? Is there a line of code you would have expected to see that you don’t? How far do you get? From the logs it looks like the Facebook Instant Game SDK and extension initialise as expected.