How do I connect with firebase's real-time database, correctly?

0 favourites
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • I'll let you know how everything goes (if the app works), tomorrow. Thanks, again!

    Let us know how it work.

  • Hey So, I tried it... well, not really; not yet, because the app won't even open now:( Now I've got a new problem... an endless progress bar (i.e. it won't even load the app at all). I've never had this problem before. The progress bar simply won't load now, at all:)

    All I did, was add the code you told me. That's all I changed. It was opening fine before I added that code. Why would it cause the progress bar not to load? If I'm using firebase, do I need to use a "loader layout"?... I'm very confused at this point.

    What's the problem? Is firebase not connecting? If that's not the problem, what do you think it is?

  • guannstar

    What do you use to compile your app? Cocoon or Phonegap?

    Anyway, you can debug your app and check what it writes in console. If it happens on your mobile device, but works in preview, then you should just simply follow this steps:

    1. Connect the phone to your computer with the wire
    2. Press F12 on a blank tab in Chrome
    3. Find 3 vertical dots near to X at top-right corner and press it
    4. More tools
    5. Remote devices
    6. You'll see your device in the list, press it and find your app
    7. Press inspect

    Then find the console and check it if there any errors.

    P.s the code I said to use couldn't break your game because it works only after some condition triggers

    Sorry if there's a lot if mistakes. I'm not so good at English

  • Hey Okay... I fixed the 'progress bar not loading' problem...

    The problem now, after testing the app, with two Android phones (to see if the real-time is working correctly), is that once I write data into the textbox and press the save button, the data's still (like before) not being sent in "real-time" to my other Android phone.

    What else could I be missing? What's creating this connecting problem?

    Do I need to use the FirebaseAPIV3 "Initialize" function, on start of layout? As well as, the Firebase plugin's "Go Online" function?

  • guannstar

    What do you mean under "real-time"? Does it not sending data at all or has some delay?

    I'm not sure, but firebase plugin make initialization by itslef. Anyway you can test if it will work with init. Btw I didn't use it in my example... So probably you don't need it.

    And one small note: you shouldn't use firebase as a multiplayer plugin for heavy realtime games - it wasn't created for these purposes.

    You can pm me your FB or whatever if you want to sort out everyting faster.

  • HEy

    No, it's not sending data at all.

    When you made your capx, did you test it with two separate phones?... And it worked?

    I would pm you my Facebook, but I don't see a pm option anymore... Strange. It's completely gone lol!.... Regardless, you can find me on Facebook, by searching for 'Sebastian Aguanno'.

  • guannstar

    I've just made one more example - a simple chat with itemTable plugin. It works ok with phone + preview (I believe it doesn't matter if I use pc or phone as the second device). I used Phonegap Build with system WebView.

  • Hey Here's a direct link to my FB... Can I please just send you my capx? I don't think I'll be able to correctly implement that code into my app (I don't really get how firebase code works yet). I don't see code that allows a user to Save into/stored in the List, so the users can retrieve it when ever they want. Also I don't see code that would allow a user to retrieve the texbox message from the List.

  • Hey , how's it going?... Still there?

  • guannstar

    I wrote to you in FB

  • Okay (sorry)... I just read your FB message. Again, I'm sorry I didn't see your message sooner.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Okay (sorry)... I just read your FB message. Again, I'm sorry I didn't see your message sooner.

    I messaged you on FB as well:)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)