Google Firebase

Discussion in 'Buildbox General Discussion' started by mmicoe, Jan 13, 2017.

  1. mmicoe

    mmicoe Avid Boxer

    Joined:
    Dec 20, 2016
    Messages:
    148
    Likes Received:
    41
    Hi,
    A question:
    I just want to know if it's possible to add firebase analytics or notifications with Buildbox.

    I exported a test android project and I see that gradle (build.gradle) is not on it to add dependencies...
    All the best!
    Mauro
     
    wcgames likes this.
  2. mmicoe

    mmicoe Avid Boxer

    Joined:
    Dec 20, 2016
    Messages:
    148
    Likes Received:
    41
    SOLVED: INTEGRATION GOOGLE FIREBASE-BUILDBOX using Android Studio
    Hi, yes, it is possible to integrate Google Firebase into BuildBox:
    Tools:
    BuildBox
    Android Studio 2.2.3
    Firebase Console
    gradle-experimental

    I tested to integrate dependencies and it works fine:
    • com.google.firebase:firebase-core:10.0.1
    • compile 'com.google.firebase:firebase-ads:10.0.1'
    • compile 'com.google.firebase:firebase-messaging:10.0.1' (Notifications tested it and working)
    Tips:
    1. Export BuildBox Android Project
    2. Import project from external model: Gradle Project (Important: Selecting AndroidManifest.xml)
    3. Import to a destination directory.
    Gradle configurations:
    main gradle project:

      1. Replace default gradle to classpath 'com.android.tools.build:gradle-experimental:0.8.3'
      2. Add dependency: classpath 'com.google.gms:google-services:3.0.0'
    gradle-wrapper.properties:
      1. Add:
    distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
    org.gradle.daemon=true
    #org.gradle.jvmargs=-Xms128m -Xmx512m
    org.gradle.configureondemand=true
    org.gradle.jvmargs=-Xmx2048m

    gradle app: (Be careful, because you have to use gradel-experimental):
    1. apply plugin: 'com.android.model.application'
    2. Add google firebase dependencies that you want: (example)
    3. Comment suppor-v4-19 (duplicated values)...
    dependencies {
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-ads:10.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.android.gms:play-services:10.0.1'
    compile files('libs/dagger-1.2.2.jar')
    compile files('libs/javax.inject-1.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    //compile files('libs/support-v4-19.0.1.jar')
    }
    apply plugin: 'com.google.gms.google-services'

    Configure your firebase console project:
    1. Download your google-services.json in your project
    Important: gradle experimental does not work using google-services.json (It is a google firebase issue, but not problem:)
    1. Add your params from google-services.json to your res/values/strings.xml
    <string name="app_id">com.xxx.yyy</string>
    <string name="google_app_id"> your mobilesdk_app_id from json</string>
    <string name="google_api_key">your current key from json</string>

    Configure your notifications if you integrated: It's easy

    Note: If you use notifications you will have to generate the signed apk and import it using adb

    Connect your phone or tablet device to the computer and Run your project in Android Studio:
    Now it must work!!!
    Wait 2 hours to see data on the firebase console! :)
    firebase.png
    All the best!
    Mauro




     
    wcgames and Qdeveloper like this.
  3. wcgames

    wcgames Boxer

    Joined:
    Oct 2, 2015
    Messages:
    56
    Likes Received:
    38
    Thanks. You are a hero ;)
     

Share This Page