Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Deploying to Facebook Instant Games - Load Spinner — Gideros Forum

Deploying to Facebook Instant Games - Load Spinner

Still learning the ropes with my first game (based on the amazing rogue on gideros tutorial), and now am stuck on deploying to Facebook Instant Games... As mentioned in another post, Gideros is an amazing platform and works 99% out of the box, but now I am stuck, and can't unstuck myself.

I export HTML, check the Facebook box, generate a zip, add the below json file, upload, and turn it on (I also did a ton of configuration on Facebook, it's almost as bad as Google Play). At this point I can load my game when logged in (it's not approved yet, so nobody else can load it as of now). The game seems to load - the background is my first scene - but I can't get rid of the loading spinner



I have this code in my main which I was hoping to solve the problem, but it didn't do the job
pcall(function() FBInstant=require "FBInstant" end)
if FBInstant then
	FBInstant.startGameAsync(function() 
		print("Loading screen removed")
		FBInstantAPI=true
	end)
else
	print("FBInstant not loaded")
end
I have one low priority suggestions on improving Facebook export (for first timers):
-Facebook requires a file fbapp-config.json. The minimal seems to be below. I figured it out after a while, but we could document this, or generate a minimal sample file upon export, but likely there is a way to keep this in the Gideros folder and have it bundled for Facebook only. I put it here in case someone else searches
{
  "instant_games": {
    "orientation": "LANDSCAPE",
    "navigation_menu_version": "NAV_FLOATING",
  }
}

Comments

  • perrochonperrochon Member
    edited April 2020
    Ok, maybe I can self-unstuck... Thought of looking at the browser console and found the following:
    FBInstant.lua Not found in archive
    gidloader.js:241 FBInstant/init.lua Not found in archive
    Not really sure how to include this the correct way
  • hgy29hgy29 Maintainer
    If FB instant was ticked during export, then that should work. Can you post your export log, to see if Gideros actually included the FBInstant.lua file ?
  • perrochonperrochon Member
    edited April 2020
    It seems to
    Exporting FBInstant.lua
    Exporting _LuaPlugins_/FBInstant.lua
    Whole log is attached

    txt
    txt
    Log.txt
    4K
  • perrochonperrochon Member
    edited April 2020
    Wait, I made some progress... I can't see the load error anymore. The moment you get involved problems go away :-) I think it might be that I added FBInstant.lua to the project directory. Is this the best practices way?



    It gets to "loading screen removed" in the log file. But the spinner is still not gone :-(
    addedFile.png
    266 x 253 - 10K
  • hgy29hgy29 Maintainer
    No, you don’t need to add FBInstant.lua to the project, gideros adds it automatically on its own in a specific sub folder where lua libs are looked for. It ends up in the .GApp file. Can you confirm the file was searched in that special folder and not found ?
  • perrochonperrochon Member
    edited April 2020
    I made two separate copies of my project, #1 and #2. The only difference is whether they link to FBInstant.lua

    #1 doesn't link to FBInstant.lua and the export looks like
    Exporting _LuaPlugins_/FBInstant.lua
    #2 does link to FBInstant.lua and the export looks like
    Exporting FBInstant.lua
    Exporting _LuaPlugins_/FBInstant.lua
    I also attached the gproj files. Looks like gproj attachments are not allowed (why? because they may contain passwords and keys?) so I renamed them to txt

    txt
    txt
    BushidoBattle1.gproj.txt
    5K
    txt
    txt
    ExportLog1.txt
    4K
    txt
    txt
    BushidoBattle2.gproj.txt
    5K
    txt
    txt
    ExportLog2.txt
    4K
  • jimlevjimlev Member
    @perrochon did you achieve to make it work ? I am trying to push a game on the FB instant games platform and I'm stuck with the loading screen too...
    My meditation plan :
    SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
    Totebo: “ Best quote ever.”
    🤔
  • hgy29hgy29 Maintainer
    edited May 2020
    @jimlev, @perrochon, since both of you had trouble with instants I decided to have another go myself this afternoon and yes there is a problem! Looks like a recent change to gideros broke it. The fix is easy: in the generated index.html (or in the template itself), move the
    <script src=gidloader.js></script>
    line after the block about FBINSTANT, so that facebook library is loaded first!

    EDIT: GitHub commit: https://github.com/gideros/gideros/commit/7d02093d0bed7343e1a6a5525f69e6f292de9a2b
    +1 -1 (+2 / -0 )Share on Facebook
  • jimlevjimlev Member
    Accepted Answer
    hgy29 said:

    The fix is easy: in the generated index.html (or in the template itself), move the

    <script src=gidloader.js></script>
    line after the block about FBINSTANT, so that facebook library is loaded first!
    Hourra ! I will give it a try this evening or tomorrow !

    My meditation plan :
    SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
    Totebo: “ Best quote ever.”
    🤔
  • I can't push to HTML right now, but I'll try this as soon as I can do HTML again.
  • I can confirm that it gets past the loading screen. (There is another issue later which prevents me from sharing the URL just yet)
  • jimlevjimlev Member
    perrochon said:

    I can confirm that it gets past the loading screen. (There is another issue later which prevents me from sharing the URL just yet)

    Same here. The loading screen problem is, now, a bad memory !

    @hgy29 : sorry if I am abusing, but could you take a moment on the index.html file of the html5 version of gideros player. I always have the problem with the loading on it. The html file is a lot different so I didn't achieved to adapt on it the solution you gave us for our 'standard' project.
    My meditation plan :
    SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
    Totebo: “ Best quote ever.”
    🤔
  • hgy29hgy29 Maintainer
    Hmm you are right and it is a problem! Looks like the bundled player doesn't contain all required files, so those files are kept from previous installation! Don't use it as it is broken, I am fixing the build scripts right now for next release.
    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.