Skip to content

Instantly share code, notes, and snippets.

@RameshRavone
Created April 8, 2017 05:50
Show Gist options
  • Select an option

  • Save RameshRavone/7a789f39631b33b2ee6144cddc36dab2 to your computer and use it in GitHub Desktop.

Select an option

Save RameshRavone/7a789f39631b33b2ee6144cddc36dab2 to your computer and use it in GitHub Desktop.
Godot firebase storage
extends Node
var firebase = null;
var sqlbridge = null;
func _ready():
if OS.get_name() == "Android":
firebase = Globals.get_singleton("FireBase");
sqlbridge = Globals.get_singleton("SQLBridge");
firebase.initWithFile("res://godot-firebase-config.json", get_instance_ID());
get_node("Buttons/Upload").connect("button_down", self, "upload");
get_node("Buttons/Download").connect("button_down", self, "download");
pass
func upload():
#firebase.upload("user://file", "userData");
firebase.upload("images/file.png", "images"); # uploades sdcard0/images/file.png => firebase - root/images
pass
func download():
firebase.download("images/file.png", "images");
pass
func _recive_message(from, key, data):
if from == "FireBase":
print("Key: ", key, " Data: ", data);
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment