- Edited
Here's our stripped version of FireBase (Analytics, Notification, RemoteConfig, Invites) mobule for android.
https://github.com/FrogLogics/GodotFireBase
Edit: Firebase Basic Notification is available, need more leave a comment.
Here's our stripped version of FireBase (Analytics, Notification, RemoteConfig, Invites) mobule for android.
https://github.com/FrogLogics/GodotFireBase
Edit: Firebase Basic Notification is available, need more leave a comment.
Nice work, thanks for sharing!
I've moved your post to "Resources" category and added a reference on this topic too :)
Hi, thanks for sharing :)
I'm getting this error when trying to compile your module:
AttributeError: 'SConsEnvironment' object has no attribute 'android_add_gradle_classpath': File "/home/godot-2.1.2-stable/SConstruct", line 326: config.configure(env) File "./modules/FireBase/config.py", line 8: env.android_add_gradle_classpath("com.google.gms:google-services:3.0.0")
I've tried to add in the build.gradle.template:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
and
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
From the firebase docs: https://firebase.google.com/docs/android/setup
But I still get this error...
I'll look at this more closely this week, but any hint to solve this problem will be welcome :)
It seems like android_add_gradle_classpath
and android_add_gradle_plugin
aren't available on Godot 2.1.2-stable. If you'll edit build.gradle.template to include these parameters you should remove theirs calls from GodotFireBase/config.py.
That simple! Everything compiled well now in the scons part. Thank you very much, @Shin-NiL . But I'm getting another error now:
:processDebugResources
/home/godot-2.1.2-stable/platform/android/java/build/intermediates/manifests/full/debug/AndroidManifest.xml:382:31-64: AAPT: No resource found that matches the given name (at 'resource' with value '@drawable/ic_stat_ic_notification').
/home/godot-2.1.2-stable/platform/android/java/build/intermediates/manifests/full/debug/AndroidManifest.xml:392:31-49: AAPT: No resource found that matches the given name (at 'resource' with value '@color/colorAccent').
:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/Android/Sdk/build-tools/23.0.3/aapt'' finished with non-zero exit value 1
BUILD FAILED
In the meantime I searched a little more about Firebase and it seems that I'll have to pay for the data I was planning to get with custom events, because only they BigQuery have access to it. So, unfortunately it is no longer an option for me anyway :(
If your GodotFireBase/config.py contents is something like this:
def can_build(plat):
return (plat == "android")
def configure(env):
if env["platform"] == "android":
env.android_add_maven_repository("url 'https://oss.sonatype.org/content/repositories/snapshots'")
#env.android_add_gradle_classpath("com.google.gms:google-services:3.0.0")
#env.android_add_gradle_plugin("com.google.gms.google-services")
env.android_add_dependency("compile 'com.google.firebase:firebase-core:10.0.1'")
env.android_add_dependency("compile 'com.google.firebase:firebase-messaging:10.0.1'")
env.android_add_dependency("compile 'com.google.firebase:firebase-invites:10.0.1'")
env.android_add_dependency("compile 'com.google.firebase:firebase-config:10.0.1'")
env.android_add_dependency("compile 'com.android.support:support-annotations:25.0.1'")
env.android_add_java_dir("android");
env.android_add_res_dir("res");
env.android_add_to_manifest("android/AndroidManifestChunk.xml");
env.android_add_default_config("applicationId 'com.froglogics.dotsndots'")
env.disable_module()
It should work, as it's adding the resource dir with env.android_add_res_dir
. In this case, I think only @FrogLogics can help you :(
PS: I didn't know that Firebase was a paid service :neutral:
I saw this part (below the commented lines) indented with spaces and all the rest indented with tabs and I ended up rearranging everything. Maybe that was the mistake. I'll try again when possible, only for the sake of knowledge. Thanks again @Shin-NiL About Firebase Analytics, they have some pre implemented gereral apps events and game events. Here's the list for the game events (https://support.google.com/firebase/answer/6317494?hl=en). These are free for visualization in their platform. But I need custom events and besides not being straight forward their visualization in the panel like the pre implemented ones, there's no option to export anything at all in a CSV or something like that, the only option to export and make the data analysis yourself is linking with the Google's BigQuery, that is a paid service, then do some SQL statements to build a table and export. In the Firebase pricing table, the free one doesn't seems to have connection with BigQuery too, so, another paid service :( So,in my opinion, if you need some general info about your game and don't need to download the data to make your own analysis, the Firebase analytics it's a good alternative. If you need some specific information (such as the most accessed game mode, how long the player can stay alive in a match, etc.), it is not a good option due to the absence of free data export options to make you own analysis and avoid the lack of these customized events in the dashboard.
PS: It turned out to be, involuntarily, a little review. Sorry if this is not the right place for this kind of comment.
@raccoon said: I saw this part (below the commented lines) indented with spaces and all the rest indented with tabs and I ended up rearranging everything. Maybe that was the mistake. I'll try again when possible, only for the sake of knowledge.
Oh man, my identantion was no good, fixed that :P
@raccon said: PS: It turned out to be, involuntarily, a little review. Sorry if this is not the right place for this kind of comment.
I think it's a valid discussion.
@raccoon @Shin-NiL Sorry, I didn't drop by. Was busy with my old projects.
And for GodotFireBase, the module is not completed I'm working toward add more features right now. Once that is done will add some more options.
Maybe I should add Alpha tag.
Update: GodotFireBase now has Google & Facebook authentication.
Get it now
Update on GodotFireBase: FireBase AdMob is integrated (Banner / Interstitial), see README.md for instructions on how to initialize module.
Update on GodotFireBase: Analytics Events
var firebase = Globals.get_singleton("FireBase"); firebase.initWithFile("res://godot-firebase-config.json", get_instance_id());
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
Update on GodotFireBase: AdMob Rewarded Video ads, And now working on Storage and more.
Admob Rewarded Video is a nice addition. If everything is working fine, your module will be the definitive solution for google services. Thanks again for sharing :)
@Shin-NiL Thanks, Now I'm working on Firebase Storage,
@FrogLogics First, thanks for sharing this module!! But man, I'm probably doing something wrong and I can't initialize the AdMob. I really dont know what could be. =( This the code used tu call the AdMob:
var firebase = null func ready(): if OS.get_name() == "Android": if Globals.has_singleton("FireBase"): print("## has singleton FireBase") firebase = Globals.get_singleton("FireBase") firebase.initWithFile("res://godot-firebase-config.json", get_instance_ID()); (...)
func _on_ad_pressed(): if firebase != null: firebase.show_interstitial_ad() #firebase.show_banner_ad(true) else: print("firebase == null")
func receive_message(from, key, data): if from == "FireBase": if key == "AdMobReward": print("json data with [RewardType & RewardAmount]: ", data); elif key == "AdMob_Video": print("AdMob rewarded video status is ", data); elif key == "AdMob_Banner": print("Banner Status: ", data); elif key == "AdMob_Interstitial" and data == "loaded": print("Interstitial Status: ", data);
####
The godot-firebase-config.json: _{ "AdMob" : true, "Authentication" : true, "Invites" : false, "RemoteConfig" : false, "Notification" : true, "Storage" : true,
"Auth" :
{
"Google" : false,
"Facebook" : false,
"FacebookAppId" : ""
},
"Ads" :
{
"BannerAd" : false,
"BannerGravity" : "BOTTOM",
"BannerAdId" : "ca-app-pub-3940256099942544/6300978111",
**"InterstitialAd" : true,
"InterstitialAdId" : "ca-app-pub-3940256099942544/1033173712",**
"RewardedVideoAd" : false,
"RewardedVideoAdId" : "ca-app-pub-3940256099942544/5224354917"
}
}_
The is the log and what happens when I try to call the Ad: (...) I/godot (11778): ## has singleton FireBase D/FireBase(11778): Data From File: D/FireBase(11778): Firebase Analytics initialized..! D/FireBase(11778): FireBase initialized. D/FireBase(11778): Refreshed token: (...) D/FireBase(11778): Token: (...)
D/FireBase(11778): AdMob:NotInitialized. D/FireBase(11778): AdMob:NotInitialized. D/FireBase(11778): AdMob:NotInitialized. D/FireBase(11778): AdMob:NotInitialized.
Problem already solved! Today, @FrogLogics helped me by Godot group on discord. The problem was that Godot wasn't exporting the "godot-firebase-config.json" because I had forgotten the "*" before ".json" under Resources tab. Such noob mistake. :#
Thanks for attention.