A Modular Firebase plugin (Android) for godot

Related tags

App GDFirebase
Overview

GDFirebase

GDFirebase is a Modular Godot Plugin for using Firebase

Platform GodotEngine LICENCE

Depends on

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

Available Features

AdMob

Analytics

Authentication Google, Facebook, Anonymoys, Email

Cloud Messaging

RemoteConfig

Storage

Getting Started

  • Install Android build Template to your GAME-PROJECT
  • Copy google-services.json you downloaded from Firebase to [GAME-PROJECT]/android/build/

Installing

Edit your [GAME-PROJECT]/android/build/AndroidManifest.xml file and add the Following inside the <application> tag

If you are using AdMob

    <!-- AdMob -->
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="[APPLICATION_ID]"/>

Replace [APPLICATION_ID] with your AdMob application id.

If you are using Authentication (Facebook)

    <!-- Facebook -->
    <meta-data android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id"/>

    <activity android:name="com.facebook.FacebookActivity"
        android:configChanges=
            "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/godot_project_name_string" />
    <activity
        android:name="com.facebook.CustomTabActivity"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/fb_login_protocol_scheme" />
        </intent-filter>
    </activity>

Now Edit your [GAME-PROJECT]/android/build/res/values/ids.xml file and add

If you are using Authentication (Facebook)

    <string name="facebook_app_id">[APPLICATION_ID]</string>
    <string name="fb_login_protocol_scheme">fb[APPLICATION_ID]</string>

Analytcis

    func _ready():
        if Engine.has_singleton("GDFirebase"):
            firebase = Engine.get_singleton("GDFirebase")
            firebase.initialize({dev_mode = true})
fun sendCustom(name: String, params: Dictionary)
fun sendScreenView(screenClass: String, screenName: String)

// Every param is an optional
fun sendAdImpression({
    value = Float,
    currency = String,
    source = String,
    platform = String,
    format = String,
    unitName = String
})
// Every param is an optional
fun sendPurchase({
    value = Float,
    currency = String,
    affiliation = String,
    coupon = String,
    shipping = String,
    tax = String,
    transactionId = String,
    items = [String]
})
// Every param is an optional
fun sendRefund({
    value = Float,
    currency = String,
    affiliation = String,
    coupon = String,
    shipping = String,
    tax = String,
    transactionId = String,
    items = [String]
})

fun sendJoinGroup(groupID: String)
fun sendSearch(item: String)
fun sendSelectContent(type: String, id: String)
fun sendShare(type: String, id: String, method: String)

fun sendLogin(method: String)
fun sendSignUp(method: String)

fun sendEarnVirtualCurrency(name: String, value: Double)
fun sendSpendVirtualCurrency(itemName: String, currencyName: String, value: Double)

fun sendTutorialBegin()
fun sendTutorialComplete()

fun sendLevelStart(name: String)
fun sendLevelEnd(name: String, {success = String}) // success is optional
fun sendLevelUp(level: Int, {character = String})  // character is optional

fun sendPostScore(score: Int, {level = Float, character = String}) // level and character is optional
fun sendUnlockAchievement(achievementId: String)

// name is optional, delay is in seconds
fun createNotification({
    name = String,
    title = String,   
    message = String,
    channelId = String,
    delay = Int,
})
fun createNotificationChannel({
    id = String,
    name = String
})

AdMob

Banner and Interstitial Video is not implemented yet.
    func _ready():
        if Engine.has_singleton("GDFirebaseAdmob"):
            admob = Engine.get_singleton("GDFirebaseAdmob")
            admob.initialize({ ... })

For testing use the official ad-units priovided by admob

Interstitial            ca-app-pub-3940256099942544/1033173712
Rewarded                ca-app-pub-3940256099942544/5224354917
Rewarded Interstitial   ca-app-pub-3940256099942544/5354046379
fun initialize({
    test = Boolean,
    interstitialUnits = [String],
    rewardUnits = [String],
    rewardedInterstitialUnits = [String]
})

// Following will show a ramdom ad-unit (Only Loaded) if more that one present
fun showInterstitial()
fun showRewarded()
fun showRewardedInterstitial()

fun showInterstitial(unit: String)
fun showRewarded(unit: String)
fun showRewardedInterstitial(unit: String)

// Get if any ad-unit is Loaded
fun isLoaded(type: String) // type: rewarded, interstitial, rewarded_interstitial
fun isLoadedFor(type: String, unit: String) // type: rewarded, interstitial, rewarded_interstitial

Authentication

    func _ready():
        if Engine.has_singleton("GDFirebaseAuth"):
            auth = Engine.get_singleton("GDFirebaseAuth")
            auth.initialize({ ... })
Authentication providers will be sepearated into there own plugins in the upcomming updates
fun initialize({
    google = {},    // OPTIONAL
    facebook = {permissions = ["email", "public_profile"]},  // OPTIONAL, Default
})

// provider: google, facebook, anonymous, email
// params: Dictionary containing email and password, for email signIn.
fun signIn(provider: String, params: {
    email: String,
    password: String
})

fun createEmailAccount(email: String, password: String)
fun revokeAccess(provider: String)
fun signOut()
fun isConnected(): Boolean

// returns: Dictionary with (uid, name, email, photo, provider, is_anonymous, email_verified)
fun getUserInfo(): Dictionary

Remote Config

RemoteConfigs default parameters .xml file is at [GAME-PROJECT]/android/build/res/xml/remote_config_defaults.xml

    func _ready():
        if Engine.has_singleton("GDFirebaseConfig"):
            config = Engine.get_singleton("GDFirebaseConfig")
            config.fetch()

Calling `fetch()` will activate the removeConfigs rightaway, [Read Mode.](https://firebase.google.com/docs/remote-config/loading)
fun setDefaults(json: String)
fun setDefaultsFile(jsonFilePath: String)
fun setDefaultsAsync(default: Dictionary)
fun fetch() 
fun fetchWith({activate = Boolean})
fun activate()

// FAILURE = 1
// NO_FETCH_YET = 0
// SUCCESS = -1
// THROTTLED = 2
fun getFetchStatus(): Int

fun getBoolean(key: String): Boolean
fun getFloat(key: String): key
fun getInt(key: String): Int
fun getString(key: String): String

fun getAll(): Dictionary

fun isReady(): Boolean

Storage

    func _ready():
        if Engine.has_singleton("GDFirebaseStorage"):
            storage = Engine.get_singleton("GDFirebaseStorage")
fun download(url: String, path: String)
fun upload(filePath: String, child: String)

Cloud Messaging

    func _ready():
        if Engine.has_singleton("GDFirebaseCloudMessaging"):
            cm = Engine.get_singleton("GDFirebaseCloudMessaging")
fun subscribe(topic: String)
fun unsubscribe(topic: String)
You might also like...
Projeto de Prova Semestral. Aplicativo Android com login e registro utilizando Firebase Authentication e consumo de API com Retrofit.
Projeto de Prova Semestral. Aplicativo Android com login e registro utilizando Firebase Authentication e consumo de API com Retrofit.

Ocean-Tech-Android Projeto de Prova Semestral. Aplicativo Android com login e cadastro utilizando Firebase Authentication e consumo de API com Retrofi

Firebase Cloud Firestore Android

Firebase Cloud Firestore Android ๐Ÿ“œ Description Android app built to demonstrate on how to build RecyclerView using Cloud Firestore with Collections,

E-commerce android app using firebase and kotlin
E-commerce android app using firebase and kotlin

RSHLN_App e-commerce android app using firebase and kotlin. Images -

FirebaseAuthentication - Login/Register Android Application using Firebase Authentication

FireBaseAuthentication This is a Firebase Authentication Application which will

Post It is the android App for uploading posts and liking them using Firebase and FireStore.

Post-it Post It is the android App for uploading posts and liking them using Firebase and FireStore. This app also uses DAO, RecycleView, Coroutines a

Firebase Authentication and realtime database implementation in Android Kotlin

Androidfirebaseauthentication Firebase is Googleโ€™s mobile platform that helps you develop high-quality apps and provides hosted backend services such

To learn how to build an e-commerce app for Android using the Firestore database from Google Firebase Technology

It is an adjustable e-commerce application that you can use to create your own online store or use it as a template to create an e-commerce app for your client. In this app we are covering such topics as Firebase basics how to upload and download data to and from an online database Displaying Images from the Cloud Creating User Profiles Uploading and displaying Products Building a Cart System Selecting images from your phone

FireApp is an open-source project that is built around Firebase Products, especially for learning purposes
FireApp is an open-source project that is built around Firebase Products, especially for learning purposes

FireApp is an open-source project that is built around Firebase Products, especially for learning purposes. This application is written entirely in Kotlin using Android Architecture Components and MVVM architecture pattern. You'll see in the code of this repo, how Firebase Products are working together.

Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.
Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Comments
  • Doesn't explain how to install

    Doesn't explain how to install

    I haven't been able to find how to install the plugins. I don't find the plugin file [plugin].aar nor the the config file plugin.gdap

    Sorry, i'am not an adroid expert. So maybe with the modification of the build.gradle something should happened so i can use something from gdscript to use google libraries, but still i would't know how.

    Sorry if i just dont find the documentation, but i have look all over the repository and havent find it.

    Thanks for the reply and sorry for comunicating here but i dont know other way.

    opened by fernandobarahona 3
Releases(0.1)
Owner
FrogSquare
FrogSquare official github. @RameshRavone
FrogSquare
๐Ÿ“š Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Components Architecture in a Modular Word Android Components Architecture in a Modular Word is a sample project that presents modern, 2020 app

Madalin Valceleanu 2.3k Jan 3, 2023
A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs

Smack About Smack is an open-source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android. Being a

Ignite Realtime 2.3k Dec 28, 2022
A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs

Smack About Smack is an open-source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android. Being a

Ignite Realtime 2.3k Dec 21, 2021
Modular android app for searching Movies on Filmnet.ir and show the details of each Move based on MVVM.

Movie_Search Modular android app for searching Movies on Filmnet.ir and show the details of each Move based on MVVM. Android MVVM Architecture Table o

ehsan kolivand 3 Nov 26, 2022
A multi-modular Gradle project that encapsulates various modules to learn Kotlin language, tools and frameworks.

KotlinLearn This is a gradle project for the sole basis of exploring and learning Kotlin language, tools and frameworks. The root project wil encapsul

Victor Kiprop 2 Oct 10, 2021
Simple Android app during a coding night. Just Learning Firebase and Android

KUI-App Simple Android app during a coding night. Just Learning Firebase and Android What we learned: Some basics of Android Basic setup of Firebase:

Kibabii University Informatics Club (KUI) 7 Aug 28, 2022
AptiBit is an android application that uses Firebase firestore to store the questions and categorize different types of aptitude questions into their categories

AptiBit is an android application that uses Firebase firestore to store the questions and categorize different types of aptitude questions into their categories. It also uses firebase authentication service that allows you to sign in to the app using your custom credentials.

Ashish Gupta 3 Jun 13, 2022
Clone of real world Chatting application Whatsapp built on Android Studio and Firebase

Clone of real world Chatting application Whatsapp built on Android Studio and Firebase

Aditya Bonde 11 May 23, 2022
โœจ Social network app made with Android Compose, full Kotlin, Firebase Authentication, Storage and Firestore ๐Ÿš€

Your friends, for real. Share daily random moments with your friends and discover who they really are. โœจ Instant Instant is a social media actually un

Vincent Guillebaud 58 Dec 23, 2022
A android plant shop app with firebase backend

PlantShop A android plant shop app with firebase backend What i learned: Create a responsive UI with ConstraintLayout Store product and save to user c

Nguyen Quoc Hung 2 Oct 4, 2022