All Projects → FrogSquare → Godotfirebase

FrogSquare / Godotfirebase

Licence: apache-2.0
FireBase for godot

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Godotfirebase

Firebase Admin Node
Firebase Admin Node.js SDK
Stars: ✭ 1,050 (+427.64%)
Mutual labels:  firebase, firebase-cloud-messaging
Laqul
A complete starter kit that allows you create amazing apps that look native thanks to the Quasar Framework. Powered by an API developed in Laravel Framework using the easy GraphQL queries language. And ready to use the Google Firebase features.
Stars: ✭ 110 (-44.72%)
Mutual labels:  firebase, firebase-cloud-messaging
Pushraven
A simple Java library to interface with Firebase Cloud Messaging (FCM) API. Pushraven allows you to push notifications to clients in very few lines of code.
Stars: ✭ 67 (-66.33%)
Mutual labels:  firebase, firebase-cloud-messaging
Whatsup
**Deprecated** Real time chat app written in Swift 4 using Firebase and OTP Authentication
Stars: ✭ 39 (-80.4%)
Mutual labels:  firebase, firebase-cloud-messaging
Quickstart Cpp
Firebase Quickstart Samples for C++
Stars: ✭ 123 (-38.19%)
Mutual labels:  firebase, firebase-cloud-messaging
Cocos2dx Cpp Sample
Firebase Cocos2d-x samples
Stars: ✭ 42 (-78.89%)
Mutual labels:  firebase, firebase-cloud-messaging
Firebase
[DEPRECATED] Unofficial Carthage support for Firebase libraries
Stars: ✭ 99 (-50.25%)
Mutual labels:  analytics, firebase
Thenetwork Open
TheNetwork is a blog cum chat app. It's completely built using firebase. Users can post, comment, like and bookmark the blogs, also users can send follow requests to connect with people. Users can create events and also prepare an event roadmap. Pagination for realtime data is also included in chats, blogs and events.
Stars: ✭ 17 (-91.46%)
Mutual labels:  firebase, firebase-cloud-messaging
Fcmsharp
Firebase Cloud Messaging (FCM) with .NET
Stars: ✭ 115 (-42.21%)
Mutual labels:  firebase, firebase-cloud-messaging
Hify
Social network powered by firebase
Stars: ✭ 115 (-42.21%)
Mutual labels:  firebase, firebase-cloud-messaging
Nativescript Plugin Firebase
🔥 NativeScript plugin for Firebase
Stars: ✭ 990 (+397.49%)
Mutual labels:  analytics, firebase
Fcm
Firebase Cloud Messaging (FCM) notifications channel for Laravel
Stars: ✭ 169 (-15.08%)
Mutual labels:  firebase, firebase-cloud-messaging
Pysoc.js
😎 Simple gsoc data scraper, search for any keyword and instantly get data about the orgs that match your search criteria, use filters to sort and analyse the data, uses fuzzy-searching to improve user-search experience
Stars: ✭ 35 (-82.41%)
Mutual labels:  analytics, firebase
Kotlin Firebase Group Chat
Group and OneonOne chat using firebase built in Kotlin similar to whatsapp.
Stars: ✭ 44 (-77.89%)
Mutual labels:  firebase, firebase-cloud-messaging
Chatapp
Chat App with all functionality private chat, contacts, friends request, find friends,for profile settings image cropper functionality, settings, logout also send text, image and all type of files, delete your files for you and everyone , login with email and mobile number and real time database firebase and for notification purpose Node Js used.
Stars: ✭ 25 (-87.44%)
Mutual labels:  firebase, firebase-cloud-messaging
React Native Firebase
🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
Stars: ✭ 9,674 (+4761.31%)
Mutual labels:  analytics, firebase
Quickstart Unity
Firebase Quickstart Samples for Unity
Stars: ✭ 553 (+177.89%)
Mutual labels:  firebase, firebase-cloud-messaging
Pyfcm
Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)
Stars: ✭ 674 (+238.69%)
Mutual labels:  firebase, firebase-cloud-messaging
Firebase Php
Unofficial Firebase Admin SDK for PHP
Stars: ✭ 1,657 (+732.66%)
Mutual labels:  firebase, firebase-cloud-messaging
Firebasecloudmessaging Android
FCM is just a demo of Android Application which implement Firebase Cloud Messaging. It made for Google I/O Extended 2016 Bangkok
Stars: ✭ 126 (-36.68%)
Mutual labels:  firebase, firebase-cloud-messaging

GodotFireBase

GodotFireBase is a Firebase integration module for Godot Android.

Platform GodotEngine LICENCE PATREON

Depends on

Godot game engine: git clone https://github.com/godotengine/godot

GodotSQL: git clone https://github.com/FrogSquare/GodotSQL

Available Features

AdMob

Analytics

Authentication [W.I.P] Google, Facebook, Twitter

Firebase Notification

RemoteConfig

Storage

Firestore (W.I.P)

Ready your project

  • open <GODOT>/platform/android/java/gradle.properties and add the following line
android.useAndroidX=true
android.enableJetifier=true

Build/Compile module

  • Copy your google-services.json file to [GODOT-ROOT]/platform/android/java/
  • Edit file modules/FireBase/config.py at line 11
p_app_id = "com.your.appid"     # config.py L:11
  • Replace com.your.appid with you android application id.

  • 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.

For customizing the module go here

FAQ

Should I rename the android_src folder after customization?

No, After customization the folder used by the module will be android, And android_src folder will be a backup for future customization.

Initialize FireBase

Edit engine.cfg and add

[android]
modules="org/godotengine/godot/FireBase,org/godotengine/godot/SQLBridge"

RemoteConfigs default parameters .xml file is at [GODOT-ROOT]/modules/FireBase/res/xml/remote_config_defaults.xml

GDScript - getting module singleton and initializing;

On 2.X

var firebase = Globals.get_singleton("FireBase");

On 3.X (latest from git)

var firebase = Engine.get_singleton("FireBase");

For Analytics only firebase.init("", get_instance_ID()) or to user RemoteConfig or Notifications (subscribing to topic)

GodotFireBase: copy godot-firebase-config.json to your projects root directord.

GodotFireBase config file, By default every feature is disabled.

{
	"AdMob" : true,
	"Authentication" : true,
	"RemoteConfig" : true,
	"Notification" : true,
	"Storage" : true,
	"Firestore" : true,

	"AuthConf" : 
	{
		"Google" : true,
		"Twitter" : true,
		"Facebook" : true,
		"FacebookAppId" : "1234566789875"
	},

	"Ads" : 
	{
		"AppId": "YOUR_APP_ID_HERE",
		"BannerAd" : true,
		"BannerGravity" : "BOTTOM",
		"BannerAdId" : "",

		"InterstitialAd" : true,
		"InterstitialAdId" : "",

		"RewardedVideoAd" : true,
		"RewardedVideoAdId" : "",

        "TestAds" : false
	}
}

And initialize firebase with file path, RewardedVideoAdId is a string array i.e "string1,string2"

func _ready():
    if OS.get_name() == "Android":
        firebase.initWithFile("res://godot-firebase-config.json", get_instance_ID())

func _receive_message(tag, from, key, data):
    if tag == "FrogSquare":
        print("From: ", from, " Key: ", key, " Data: ", data)

Using FireBase Analytics

firebase.send_events("EventName", Dictionary)
firebase.send_custom("TestKey", "SomeValue")

firebase.setScreenName("Screen_name")
firebase.sendAchievement("someAchievementId")		# unlock achievement
firebase.join_group("clan_name")			# join clan/group
firebase.level_up("character_name", level)		# send character level
firebase.post_score("charcter name", level, score)	# post your score
firebase.earn_currency("currency", amount);		# when play earn some virtual currency gold/Diamond/any
firebase.spend_currency("item_id", "currency", amount)	# when user spend virtual currency

firebase.tutorial_begin()				# tutorial begin
firebase.tutorial_complete()				# tutorial end

Reference: https://support.google.com/firebase/answer/6317494?hl=en

AlertDialog aditional

firebase.alert("Message goes here..!") # Show a simple AlertDialog
firebase.set_debug(true) # Enable/Disable `GodotFireBase` debug messages

Authentication

For Facebook edit res/values/ids.xml and replace facebook_app_id with your Facebook App Id

firebase.authConfig("'Google':true,'Facebook':true") # Configure Auth service

firebase.get_id_token()

firebase.google_sign_in() # Firebase connect to google.
firebase.facebook_sign_in() # Firebase connect to facebook.
firebase.twitter_sign_in() # Firebase connect to twitter.
firebase.anonymous_sign_in() # Firebase connect anonymously.

firebase.google_sign_out() # Firebase disconnect from google.
firebase.facebook_sign_out() # Firebase disconnect from facebook.
firebase.twitter_sign_out() # Firebase disconnect from twitter.
firebase.anonymous_sign_out() # Firebase disconnect anonymously.

var gUserDetails = firebase.get_google_user() # returns name, email_id, photo_uri
var fbUserDetails = firebase.get_facebook_user() # returns name, email_id, photo_uri

firebase.google_revoke_access()
firebase.facebook_revoke_access()

firebase.is_google_connected() # bool check for google authentication (google)
firebase.is_facebook_connected() # bool check for facebook authentication (facebook)
firebase.is_anonymous_connected() # bool check for facebook authentication (anonymous)

More for facebook permissions

firebase.facebook_has_permission("publish_actions") # Check for availabe permission

firebase.revoke_facebook_permission("publish_actions") # revoke permission

firebase.ask_facebook_publish_permission("publish_actions"); # asking write permission

firebase.ask_facebook_read_permission("email"); # asking read only permission

firbase.get_facebook_permissions() # getting available permissions

Recive message from java

func _receive_message(tag, from, key, data):
    if tag == "FrogSquare":
        if from == "Auth":
            if key == "GoogleLogin" && data == "true": print("User Signed in.")
            if key == "FacebookLogin" && data == "true": print("User Signed in.")

Firebase Notification API

firebase.subscribeToTopic("topic") # Subscribe to particular topic.
firebase.getToken() # Get current client TokenID

If recived notifiction has a payload, it will be saved inside SQL Database under key: "firebase_notification_data"

firebase.notifyInMins("message", 60) # Shedule notification in 60 min
firebase.notifyInSecs("message", 3200) # Shedule notification in 3200 seconds

var dict = {}
dict["title"] = "Notification title"
dict["message"] = "This is a text message"
dict["image_uri"] = "res://big_image_in_notification_body.png"
dict["type"] = "text"

firebase.notifyOnComplete(dict, 3200) # Shedule notification in 3200 seconds

RemoteConfig API

firebase.getRemoteValue("remote_key") # Return String value

Settings RemoteConfig default values

var defs = Dictionary()
defs["some_remoteconfig_key1"] = "remote_config_value1"
defs["some_remoteconfig_key2"] = "remote_config_value2"

firebase.setRemoteDefaults(defs.to_json())

OR load from json file

firebase.setRemoteDefaultsFile("res://path/to/jsonfile.json")

Firebase Storage

# Upload Files from sdcard
firebase.upload("images/file", "destFolder") # uploads file from sdcard to firebase

# Download Files from Firebase
firebase.download("file", "images") # Saves file from firebase to sdcard

Firebase AdMob

firebase.is_banner_loaded()     # Returns `true` if banner is loaded
firebase.is_interstitial_loaded() # Returns `true` if interstitial is loaded

firebase.show_banner_ad(true)	# Show Banner Ad
firebase.show_banner_ad(false)	# Hide Banner Ad
firebase.set_banner_unitid("unit_id") # Change current Ad unit ID

firebase.show_interstitial_ad() # Show Interstitial Ad
firebase.show_rewarded_video()	# Show Rewarded Video Ad
firebase.show_rvideo("unit_id") # Show Rewarded Video Ad

firebase.request_rewarded_video_status() # Request the rewarded video status

AdMob Recive message from java

func _receive_message(tag, from, key, data):
    if tag == "FrogSquare" and from == "AdMob":
        if key == "AdMobReward":
            # when rewared video play complete
            print("json data with [RewardType & RewardAmount]: ", data);

        elif key == "AdMob_Video":
            # when rewarded video loaded
            # data will be `loaded` or `load_failed and `loaded` or `not_loaded` with `firebase.request_rewarded_video_status()`
            print("AdMob rewarded video status is ", data);

        elif key == "AdMob_Banner":
            # when banner loaded
            # data will be `loaded` or `load_failed`
            print("Banner Status: ", data);

        elif key == "AdMob_Interstitial" and data == "loaded":
            # when Interstitial loaded
            # data will be `loaded` or `load_failed`
            print("Interstitial Status: ", data);

Firebase Firestore

firebase.add_document("collection_name", dict) # Auto created new Document under collection_name
firebase.set_document("collection_name", "document_name", data) # Set document data, Data's are merged by default
firebase.load_document("collection_name") # load or retrive from the server,

# Note: documents will be sent to the `_receive_message` function as json

Sharing

# Simple text based sharing. Include links if needed. 'Subject' can be null or empty.
firebase.share("Message", "Subject")

Note

While exporting, don't forget to add *.json under Resources tab, alt text

Log Event

adb -d logcat godot:V FrogSquare:V DEBUG:V AndroidRuntime:V ValidateServiceOp:V *:S
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].