Skip to first unread message

dBorzack

unread,
Jun 25, 2016, 12:51:55 PM6/25/16
to MIT App Inventor Forum
Hello,
I'm using experimental Firebase with default URL, with discrete success too. Now I'm intrested to use a customized firebase url. Someone know how do it?

Thanks

Taifun

unread,
Jun 25, 2016, 7:06:28 PM6/25/16
to MIT App Inventor Forum
copied from here https://amerkashi.wordpress.com/2016/03/06/firebasechat/

By default, it uses the shared default Firebase account. You can change this behaviour though using the FirebaseDB designer properties. Just create a FirebaseDB account for yourself and change the designer property to point to your own account.

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

dBorzack

unread,
Jun 25, 2016, 7:21:49 PM6/25/16
to MIT App Inventor Forum
Yes I read it, but the question is how do it?


Abraham Getzler

unread,
Jun 26, 2016, 1:27:58 PM6/26/16
to MIT App Inventor Forum
Start here and hit "create project".

ABG

dBorzack

unread,
Jun 26, 2016, 1:32:52 PM6/26/16
to MIT App Inventor Forum
Thanks, I did this, so I've a firebase URL. Now I don't know how take Firebase Token.

Abraham Getzler

unread,
Jun 26, 2016, 1:56:19 PM6/26/16
to MIT App Inventor Forum
It's been a while since I did mine, and Firebase changed their web site.

I think the attached is the route thru the jungle ...

Get into your project (app?)
Start at AUTH on the left, then hit Web Setup in the upper right.
A popup will appear with several text values you can copy.
ABG


firebase_auth.png

dBorzack

unread,
Jun 26, 2016, 2:10:24 PM6/26/16
to MIT App Inventor Forum
Thanks Abraham,
my doubt is that the Defaul firebase token on ai2 is this

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzQwNDkxODY5LCJ2IjowLCJkIjp7InVpZCI6ImU2NzRlNDNlLWRkMGMtNDdhMC05ZDUyLTQ1MTllMmQ2YjVjNCIsInByb2plY3QiOiIiLCJkZXZlbG9wZXIiOiJib3J6YWNrMUBnbWFpbDpjb20ifSwiaWF0IjoxNDY2OTU5MDY5fQ.CjEcgLqqHIcBcL8EGW18lXFvAOE0BVoWbaZj8Soygjg

when I try to create one customized with firebase console (also following your suggest) there isn't nothing similar at this, only API KEY, databaseURL, and so on.

So I don't know if I'm doing the right thing.




Abraham Getzler

unread,
Jun 26, 2016, 3:13:32 PM6/26/16
to MIT App Inventor Forum
Both the AI2 Token and the FireBaseDB API-Key are 40 characters (or so, I may be off by 1 or 2).

I'll bet they are the same thing.

Try it.

ABG

Abraham Getzler

unread,
Jun 26, 2016, 3:32:50 PM6/26/16
to MIT App Inventor Forum
I think the Token you got by default was so much longer because it was meant to work with the default AI2 shared Firebase database instance, and needed the extra length to distinguish authors and projects within the same data base (URL).

My leftover token in my old project was only 40 characters, to go with the URL of my own free instance.

It worked for me in my experiments a few months ago.

I see disclaimers in AI2 docs of March 2016 warning that private data base support doesn't exist yet.
I haven't tried it recently, though it worked for me a while ago.

The easiest test is to paste in your API-Key and URL, insert a few items theu AI2, and inspect the data base thru the firebase console database section.


ABG


dBorzack

unread,
Jun 26, 2016, 4:13:46 PM6/26/16
to MIT App Inventor Forum
Thanks,
I'll try to follow your suggest with api key.


dBorzack

unread,
Jun 29, 2016, 7:18:04 PM6/29/16
to MIT App Inventor Forum
Hi  Abraham, I've tried to follow your suggestion without success.
I think the protocol is more complicate now.


Abraham Getzler

unread,
Jun 29, 2016, 8:50:16 PM6/29/16
to MIT App Inventor Forum
I tried a little test Firebase app on the stock emulator, and got a nasty surprise (see attached.)
I will try a re-download and install, to see if that helps.
So far, the emulator file name and size don't look different than my last download....
ABG

Android_too_old_for_Firebase.png

Abraham Getzler

unread,
Jun 29, 2016, 9:29:36 PM6/29/16
to MIT App Inventor Forum

dBorzack

unread,
Jun 30, 2016, 7:17:57 PM6/30/16
to MIT App Inventor Forum
Hello Abraham ,
I've tried also on a phone, but doesn't work the same. Maybe I wrong something, do you have more detail to me about the procedure used in the past?
Thanks 

Abraham Getzler

unread,
Jun 30, 2016, 9:42:00 PM6/30/16
to MIT App Inventor Forum
I finally got FirebaseDB working in an emulator, but I had to use a recent Genymotion emulator (free).

I attached screen shots using a test app (.aia included) and my personal trash instance.

Things I had to do ...

Install GenyMotion free
Download and start a virtual device from Genymotion
download the Companion .apk file from the AI2 USB Setup linkat http://appinventor.mit.edu/explore/ai2/setup-device-usb.html
Drag the .apk file into the running Genymotion device Window to install it.
(It should start running by itself)
Start aistarter.exe on your pc to watch for connection
Set up your firebase db intance , go into its console, and go to auth tab / web setup
Copy these two items into your Ai2 Designer firebasedb component attributes:
  (turn off the default flag first and clear the token and URL fields )
  apikey goes into Firebase Token
  databseURL goes into FirebaseURL
  leave the projectBucket same as the AI2 app name to allow reuse of the storage
From Ai2, Connect-->USB 
The app should start on the emulator.

ABG


  


Designer and firebase settings.png
Download the Companion apk and drag it into a running Genymotion device.png
firebase auth web setup.png
firebase console.png
firebasedb_token_test.aia
Genymotion virtual machines.png
tags list display result.png
after inserting tag b value bee.png
blocks.png

dBorzack

unread,
Jul 5, 2016, 6:49:36 PM7/5/16
to MIT App Inventor Forum
I don't know why but I've this kind of error "permission denied"


dBorzack

unread,
Jul 5, 2016, 7:09:04 PM7/5/16
to MIT App Inventor Forum
Finally works, I've changed rules too, with this snippet:

// These rules give anyone, even people who are not users of your app,
// read and write access to your database
{
 
"rules": {
   
".read": true,
   
".write": true
 
}
}

dBorzack

unread,
Jul 6, 2016, 3:08:19 PM7/6/16
to MIT App Inventor Forum

this is database with a pubblic access, with API Key. Is there a way to do with a private account too?

Reply all
Reply to author
Forward
0 new messages