FireBase android module

FrogLogicsFrogLogics Posts: 9Member
edited March 25 in Resources

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.


Tags :

Comments

  • Shin-NiLShin-NiL Posts: 107Moderator

    Nice work, thanks for sharing!

    I've moved your post to "Resources" category and added a reference on this topic too :)

  • raccoonraccoon Posts: 8Member
    edited March 22

    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 :)

  • Shin-NiLShin-NiL Posts: 107Moderator

    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.

  • raccoonraccoon Posts: 8Member

    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 :(

  • Shin-NiLShin-NiL Posts: 107Moderator
    edited March 23

    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:

  • raccoonraccoon Posts: 8Member

    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.

  • Shin-NiLShin-NiL Posts: 107Moderator
    edited March 23

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

  • FrogLogicsFrogLogics Posts: 9Member

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

  • FrogLogicsFrogLogics Posts: 9Member

    Update: GodotFireBase now has Google & Facebook authentication.

    Get it now

  • FrogLogicsFrogLogics Posts: 9Member

    Update on GodotFireBase: FireBase AdMob is integrated (Banner / Interstitial), see README.md for instructions on how to initialize module.

  • FrogLogicsFrogLogics Posts: 9Member

    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

  • FrogLogicsFrogLogics Posts: 9Member

    Update on GodotFireBase: AdMob Rewarded Video ads, And now working on Storage and more.

  • Shin-NiLShin-NiL Posts: 107Moderator
    edited April 3

    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 :)

  • FrogLogicsFrogLogics Posts: 9Member

    @Shin-NiL Thanks, Now I'm working on Firebase Storage,

Sign In or Register to comment.