Skip to content

Latest commit

 

History

History
85 lines (61 loc) · 2.39 KB

INSTALL-ANDROID.md

File metadata and controls

85 lines (61 loc) · 2.39 KB

Android Setup (Required)

With npm

$ npm install capacitor-background-geolocation-firebase --save
$ npx cap sync

With yarn

$ yarn add capacitor-background-geolocation-firebase
$ npx cap sync

Gradle Configuration

📂 android/build.gradle

allprojects {
    repositories {
        google()
        mavenCentral()
        // capacitor-background-geolocation
        maven { url("${project(':transistorsoft-capacitor-background-geolocation').projectDir}/libs") }
        maven { url 'https://developer.huawei.com/repo/' }
        // capacitor-background-fetch
        maven { url("${project(':transistorsoft-capacitor-background-fetch').projectDir}/libs") }
+       // capacitor-background-geolocation-firebase
+       maven { url("${project(':transistorsoft-capacitor-background-geolocation-firebase').projectDir}/libs") }
    }
}

📂 android/variables.gradle

ext {
    .
    .
    .
+   FirebaseSDKVersion = "33.4.0" // or as-desired

}

Note

the param ext.FirebaseSdkVersion controls the imported version of the Firebase SDK (com.google.firebase:firebase-bom). Consult the Firebase Release Notes to determine the latest version of the Firebase SDK

📂 google-services.json

Download your google-services.json from the Firebase Console. Copy the file to your android/app folder.

AndroidManifest.xml

📂 android/app/src/main/AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.transistorsoft.backgroundgeolocation.react">

  <application
    android:name=".MainApplication"
    android:allowBackup="true"
    android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher"
    android:theme="@style/AppTheme">

    <!-- capacitor-background-geolocation-firebase licence -->
+   <meta-data android:name="com.transistorsoft.firebaseproxy.license" android:value="YOUR_LICENCE_KEY_HERE" />
    .
    .
    .
  </application>
</manifest>

ℹ️ Purchase a License