{"id":15161341,"url":"https://github.com/frogsquare/godotfirebase","last_synced_at":"2025-09-30T13:32:19.549Z","repository":{"id":64044265,"uuid":"85458358","full_name":"FrogSquare/GodotFireBase","owner":"FrogSquare","description":"FireBase for godot, new version https://github.com/FrogSquare/GDFirebase","archived":true,"fork":false,"pushed_at":"2022-07-01T08:30:05.000Z","size":320,"stargazers_count":199,"open_issues_count":19,"forks_count":35,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-09-29T05:13:36.253Z","etag":null,"topics":["alpha","analytics","firebase","firebase-cloud-messaging","firebase-notification","firebase-remote-config","godot","godotengine"],"latest_commit_sha":null,"homepage":"https://frogsquare.com/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FrogSquare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-19T07:26:37.000Z","updated_at":"2024-08-14T07:25:27.000Z","dependencies_parsed_at":"2022-12-07T08:45:07.893Z","dependency_job_id":null,"html_url":"https://github.com/FrogSquare/GodotFireBase","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrogSquare%2FGodotFireBase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrogSquare%2FGodotFireBase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrogSquare%2FGodotFireBase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrogSquare%2FGodotFireBase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrogSquare","download_url":"https://codeload.github.com/FrogSquare/GodotFireBase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234744628,"owners_count":18879955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpha","analytics","firebase","firebase-cloud-messaging","firebase-notification","firebase-remote-config","godot","godotengine"],"created_at":"2024-09-27T00:04:28.311Z","updated_at":"2025-09-30T13:32:14.159Z","avatar_url":"https://github.com/FrogSquare.png","language":"Java","funding_links":["https://www.patreon.com/bePatron?u=5130479"],"categories":[],"sub_categories":[],"readme":"# GodotFireBase\n\nGodotFireBase is a Firebase integration module for Godot Android.\n\n### Project has been moved to newer repo [GDFirebase](https://github.com/FrogSquare/GDFirebase)\n\n[![Platform](https://img.shields.io/badge/Platform-Android-green.svg)](https://github.com/FrogSquare/GodotFireBase)\n[![GodotEngine](https://img.shields.io/badge/Godot_Engine-2.X%20/%203.X-blue.svg)](https://github.com/godotengine/godot)\n[![LICENCE](https://img.shields.io/badge/License-Apache_V2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![PATREON](https://img.shields.io/badge/Patreon-support-yellow.svg)](https://www.patreon.com/bePatron?u=5130479)\n\n# Depends on\n\n\u003e Godot game engine: `git clone https://github.com/godotengine/godot`\n\n\u003e GodotSQL: `git clone https://github.com/FrogSquare/GodotSQL`\n\n# Available Features\n\n\u003e AdMob\n\n\u003e Analytics\n\n\u003e Authentication [W.I.P] Google, Facebook, Twitter\n\n\u003e Firebase Notification\n\n\u003e RemoteConfig\n\n\u003e Storage\n\n\u003e Firestore (W.I.P)\n\n# Ready your project\n* open `\u003cGODOT\u003e/platform/android/java/gradle.properties` and add the following line\n```\nandroid.useAndroidX=true\nandroid.enableJetifier=true\n```\n\n# Build/Compile module\n\n* Copy your `google-services.json` file to `[GODOT-ROOT]/platform/android/java/`\n* Edit file modules/FireBase/config.py at line 11\n\n```\np_app_id = \"com.your.appid\"     # config.py L:11\n```\n\n* Replace `com.your.appid` with you android application id.\n\n* To build Admob you need to set your AdMob Application ID in the `AndroidManifestChunk.xml` file. To do this, edit the file `android_src/AndroidManifestChunk.xml`. Navigate to the end of the file. Replace the **value** for APPLICATION_ID with your real application ID.\n\n\n*For customizing the module go [here](https://github.com/FrogSquare/GodotFireBase/wiki/Customize-GodotFireBase)*\n\n# FAQ\n\n**Should I rename the android_src folder after customization?**\n\n\u003e No, After customization the folder used by the module will be `android`, And `android_src` folder will be a backup for future customization.\n\n# Initialize FireBase\n\nEdit engine.cfg and add\n\n```\n[android]\nmodules=\"org/godotengine/godot/FireBase,org/godotengine/godot/SQLBridge\"\n```\n\nRemoteConfigs default parameters `.xml` file is at `[GODOT-ROOT]/modules/FireBase/res/xml/remote_config_defaults.xml`\n\n# GDScript - getting module singleton and initializing;\n\n### On 2.X\n\n```\nvar firebase = Globals.get_singleton(\"FireBase\");\n```\n\n### On 3.X (latest from git)\n\n```\nvar firebase = Engine.get_singleton(\"FireBase\");\n```\n\nFor Analytics only `firebase.init(\"\", get_instance_ID())` or to user RemoteConfig or Notifications (subscribing to topic)\n\n# GodotFireBase: copy `godot-firebase-config.json` to your projects root directord.\nGodotFireBase config file, By default every feature is disabled.\n\n```\n{\n\t\"AdMob\" : true,\n\t\"Authentication\" : true,\n\t\"RemoteConfig\" : true,\n\t\"Notification\" : true,\n\t\"Storage\" : true,\n\t\"Firestore\" : true,\n\n\t\"AuthConf\" : \n\t{\n\t\t\"Google\" : true,\n\t\t\"Twitter\" : true,\n\t\t\"Facebook\" : true,\n\t\t\"FacebookAppId\" : \"1234566789875\"\n\t},\n\n\t\"Ads\" : \n\t{\n\t\t\"AppId\": \"YOUR_APP_ID_HERE\",\n\t\t\"BannerAd\" : true,\n\t\t\"BannerGravity\" : \"BOTTOM\",\n\t\t\"BannerAdId\" : \"\",\n\n\t\t\"InterstitialAd\" : true,\n\t\t\"InterstitialAdId\" : \"\",\n\n\t\t\"RewardedVideoAd\" : true,\n\t\t\"RewardedVideoAdId\" : \"\",\n\n        \"TestAds\" : false\n\t}\n}\n```\n\nAnd initialize firebase with file path, `RewardedVideoAdId` is a string array i.e `\"string1,string2\"`\n\n```\nfunc _ready():\n    if OS.get_name() == \"Android\":\n        firebase.initWithFile(\"res://godot-firebase-config.json\", get_instance_ID())\n\nfunc _receive_message(tag, from, key, data):\n    if tag == \"FrogSquare\":\n        print(\"From: \", from, \" Key: \", key, \" Data: \", data)\n```\n\n# Using FireBase Analytics\n\n```\nfirebase.send_events(\"EventName\", Dictionary)\nfirebase.send_custom(\"TestKey\", \"SomeValue\")\n\nfirebase.setScreenName(\"Screen_name\")\nfirebase.sendAchievement(\"someAchievementId\")\t\t# unlock achievement\nfirebase.join_group(\"clan_name\")\t\t\t# join clan/group\nfirebase.level_up(\"character_name\", level)\t\t# send character level\nfirebase.post_score(\"charcter name\", level, score)\t# post your score\nfirebase.earn_currency(\"currency\", amount);\t\t# when play earn some virtual currency gold/Diamond/any\nfirebase.spend_currency(\"item_id\", \"currency\", amount)\t# when user spend virtual currency\n\nfirebase.tutorial_begin()\t\t\t\t# tutorial begin\nfirebase.tutorial_complete()\t\t\t\t# tutorial end\n\nReference: https://support.google.com/firebase/answer/6317494?hl=en\n```\n\n# AlertDialog aditional\n\n```\nfirebase.alert(\"Message goes here..!\") # Show a simple AlertDialog\nfirebase.set_debug(true) # Enable/Disable `GodotFireBase` debug messages\n```\n\n# Authentication\n\nFor Facebook edit `res/values/ids.xml` and replace facebook_app_id with your Facebook App Id\n\n```\nfirebase.authConfig(\"'Google':true,'Facebook':true\") # Configure Auth service\n\nfirebase.get_id_token()\n\nfirebase.google_sign_in() # Firebase connect to google.\nfirebase.facebook_sign_in() # Firebase connect to facebook.\nfirebase.twitter_sign_in() # Firebase connect to twitter.\nfirebase.anonymous_sign_in() # Firebase connect anonymously.\n\nfirebase.google_sign_out() # Firebase disconnect from google.\nfirebase.facebook_sign_out() # Firebase disconnect from facebook.\nfirebase.twitter_sign_out() # Firebase disconnect from twitter.\nfirebase.anonymous_sign_out() # Firebase disconnect anonymously.\n\nvar gUserDetails = firebase.get_google_user() # returns name, email_id, photo_uri\nvar fbUserDetails = firebase.get_facebook_user() # returns name, email_id, photo_uri\n\nfirebase.google_revoke_access()\nfirebase.facebook_revoke_access()\n\nfirebase.is_google_connected() # bool check for google authentication (google)\nfirebase.is_facebook_connected() # bool check for facebook authentication (facebook)\nfirebase.is_anonymous_connected() # bool check for facebook authentication (anonymous)\n```\n\nMore for facebook permissions\n\n```\nfirebase.facebook_has_permission(\"publish_actions\") # Check for availabe permission\n\nfirebase.revoke_facebook_permission(\"publish_actions\") # revoke permission\n\nfirebase.ask_facebook_publish_permission(\"publish_actions\"); # asking write permission\n\nfirebase.ask_facebook_read_permission(\"email\"); # asking read only permission\n\nfirbase.get_facebook_permissions() # getting available permissions\n```\n\nRecive message from java\n\n```\nfunc _receive_message(tag, from, key, data):\n    if tag == \"FrogSquare\":\n        if from == \"Auth\":\n            if key == \"GoogleLogin\" \u0026\u0026 data == \"true\": print(\"User Signed in.\")\n            if key == \"FacebookLogin\" \u0026\u0026 data == \"true\": print(\"User Signed in.\")\n```\n\n# Firebase Notification API\n\n```\nfirebase.subscribeToTopic(\"topic\") # Subscribe to particular topic.\nfirebase.getToken() # Get current client TokenID\n\nIf recived notifiction has a payload, it will be saved inside SQL Database under key: \"firebase_notification_data\"\n\nfirebase.notifyInMins(\"message\", 60) # Shedule notification in 60 min\nfirebase.notifyInSecs(\"message\", 3200) # Shedule notification in 3200 seconds\n\nvar dict = {}\ndict[\"title\"] = \"Notification title\"\ndict[\"message\"] = \"This is a text message\"\ndict[\"image_uri\"] = \"res://big_image_in_notification_body.png\"\ndict[\"type\"] = \"text\"\n\nfirebase.notifyOnComplete(dict, 3200) # Shedule notification in 3200 seconds\n```\n\n# RemoteConfig API\n\n```\nfirebase.getRemoteValue(\"remote_key\") # Return String value\n```\n\n# Settings RemoteConfig default values\n\n```\nvar defs = Dictionary()\ndefs[\"some_remoteconfig_key1\"] = \"remote_config_value1\"\ndefs[\"some_remoteconfig_key2\"] = \"remote_config_value2\"\n\nfirebase.setRemoteDefaults(defs.to_json())\n```\n\nOR load from json file\n\n```\nfirebase.setRemoteDefaultsFile(\"res://path/to/jsonfile.json\")\n```\n\n# Firebase Storage\n\n```\n# Upload Files from sdcard\nfirebase.upload(\"images/file\", \"destFolder\") # uploads file from sdcard to firebase\n\n# Download Files from Firebase\nfirebase.download(\"file\", \"images\") # Saves file from firebase to sdcard\n```\n\n# Firebase AdMob\n\n```\nfirebase.is_banner_loaded()     # Returns `true` if banner is loaded\nfirebase.is_interstitial_loaded() # Returns `true` if interstitial is loaded\n\nfirebase.show_banner_ad(true)\t# Show Banner Ad\nfirebase.show_banner_ad(false)\t# Hide Banner Ad\nfirebase.set_banner_unitid(\"unit_id\") # Change current Ad unit ID\n\nfirebase.show_interstitial_ad() # Show Interstitial Ad\nfirebase.show_rewarded_video()\t# Show Rewarded Video Ad\nfirebase.show_rvideo(\"unit_id\") # Show Rewarded Video Ad\n\nfirebase.request_rewarded_video_status() # Request the rewarded video status\n```\n\nAdMob Recive message from java\n\n```\nfunc _receive_message(tag, from, key, data):\n    if tag == \"FrogSquare\" and from == \"AdMob\":\n        if key == \"AdMobReward\":\n            # when rewared video play complete\n            print(\"json data with [RewardType \u0026 RewardAmount]: \", data);\n\n        elif key == \"AdMob_Video\":\n            # when rewarded video loaded\n            # data will be `loaded` or `load_failed and `loaded` or `not_loaded` with `firebase.request_rewarded_video_status()`\n            print(\"AdMob rewarded video status is \", data);\n\n        elif key == \"AdMob_Banner\":\n            # when banner loaded\n            # data will be `loaded` or `load_failed`\n            print(\"Banner Status: \", data);\n\n        elif key == \"AdMob_Interstitial\" and data == \"loaded\":\n            # when Interstitial loaded\n            # data will be `loaded` or `load_failed`\n            print(\"Interstitial Status: \", data);\n```\n\n# Firebase Firestore\n\n```\nfirebase.add_document(\"collection_name\", dict) # Auto created new Document under collection_name\nfirebase.set_document(\"collection_name\", \"document_name\", data) # Set document data, Data's are merged by default\nfirebase.load_document(\"collection_name\") # load or retrive from the server,\n\n# Note: documents will be sent to the `_receive_message` function as json\n```\n\n# Sharing\n```\n# Simple text based sharing. Include links if needed. 'Subject' can be null or empty.\nfirebase.share(\"Message\", \"Subject\")\n```\n\n# Note\n\nWhile exporting, don't forget to add `*.json` under Resources tab,\n![alt text](http://preview.ibb.co/fTwC8Q/Screenshot_from_2017_06_17_18_44_25.png)\n\n# Log Event\n\n```\nadb -d logcat godot:V FrogSquare:V DEBUG:V AndroidRuntime:V ValidateServiceOp:V *:S\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrogsquare%2Fgodotfirebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrogsquare%2Fgodotfirebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrogsquare%2Fgodotfirebase/lists"}