React Native Android Files to change and what to add

📘

Objective

Implement the Android Bubbl Plugin dependencies into a React Native app.

📘

Audience

React Native App Developer

android {
   ...
   packagingOptions {
        exclude 'AndroidManifest.xml'
        exclude 'resources.arsc'
   }
   ...
}
...
apply plugin: 'com.android.application'
...
dependencies {
   ...
  implementation 'tech.bubbl:bubbl-sdk:2.1.3'
  implementation 'tech.bubbl.sdk.android.googlelibs:youtube-player:1.0.3'

  implementation "com.google.android.gms:play-services-location:16.0.0"
  implementation "com.google.android.gms:play-services-maps:16.0.0"
  implementation "com.google.android.gms:play-services-places:16.0.0"
  
  implementation "com.google.android.exoplayer:exoplayer-core:2.18.1"
  implementation "com.google.android.exoplayer:exoplayer-dash:2.18.1"
  implementation "com.google.android.exoplayer:exoplayer-hls:2.18.1"
  implementation "com.google.android.exoplayer:exoplayer-ui:2.18.1"
  implementation "com.google.android.exoplayer:exoplayer-smoothstreaming:2.18.1"
  
  implementation 'androidx.appcompat:appcompat:1.0.0'
  implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  implementation 'com.google.android.material:material:1.0.0'
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  implementation "com.google.android.gms:play-services-location:16.0.0"
  implementation "com.google.android.gms:play-services-maps:16.0.0"
  implementation "com.google.android.gms:play-services-places:16.0.0"
  implementation 'com.google.code.gson:gson:2.10.1'
  
  implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
  
  implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.3'
  
  implementation 'com.dreizak:miniball:1.0.3'
   ...
}

If youtube-player is already included in the project change the bubbl-sdk entry to:

...
   implementation ('tech.bubbl:bubbl-sdk:2.1.3') {
       exclude group: 'tech.bubbl.sdk.android.googlelibs', module: 'youtube-player'
   }
   ...
-dontwarn okhttp3.internal.platform.*

-keep class tech.bubbl.** { *; }
-keep interface tech.bubbl.** { *; }

📘

Google Geolocation API Key

For details on how to set up a Google Geolocation API Key see here.

👍

Note

@string/google_api_key will automatically be created by Google

<application
      android:name=".MainApplication"
      ...
      >
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_api_key" />
        ...
</application>

To provide your app’s custom icons for the Bubbl notifications please add the exact metadata name with your own corresponding resource ids in your manifest file, like in the example below:

<application>
  ...
        <meta-data
           android:name="large_icon"
           android:resource="@drawable/your_large_icon"/>
        <meta-data
           android:name="small_icon"
           android:resource="@drawable/your_small_icon"/>
        <meta-data
           android:resource="@drawable/your_small_white_icon"
           android:name="small_white_icon"/>
        ...
</application>
buildscript {
    
    dependencies {
        ...
        classpath('com.android.tools.build:gradle:4.0.1')
        ...
        classpath('com.google.gms:google-services:4.3.4')
        ...
    }

    allprojects {
        repositories {
            ...
            maven {url "https://android19-bubbl-sdk.s3.eu-west-2.amazonaws.com/" }
            ...
        }
    }
}
<string name="default_location_permission_explanation">Bubbl SDK needs access to device location for it\'s core functionality, otherwise you will not see the messages from Bubbl.</string>
<string name="default_run_background_explanation">To ensure you receive interesting and useful content at the right time and in the right place, this app’s core functionality needs to run in the background.</string>
<string name="default_location_background_explanation">This app collects location data to enable the delivery to your phone of content rich notifications, triggered by time, context and location.  This ensures the user receives interesting and useful content at the right time and in the right place even when the app is closed or not in use.</string>

<string name="tech_bubbl_sdk_payloads_title">My Messages</string>
<string name="tech_bubbl_sdk_no_payloads_yet">You have no messages</string>