transistorsoft / cordova-background-geolocation-firebase

Firebase Adapter for Cordova Background Geolocation
MIT License
7 stars 5 forks source link

Doubts before integrating #10

Closed Curbe8 closed 5 years ago

Curbe8 commented 5 years ago

Your Environment

A description of the environment is not necessary for this issue. Just clarify that I use Firebase Realtime Database and Ionic 3.

Description

This problem was opened with the intention of clearing doubts. Is it possible to integrate with Real Time Database or only with Cloud Firestore? Is the integration of cordova-background-geolocation necessary for the use of this add-on or only with the integration of Cordova-background-geolocation-firebase is enough?

Thank you!

christocracy commented 5 years ago

with Real Time Database or only with Cloud Firestore?

Firestore only.

Is the integration of cordova-background-geolocation necessary for the use of this add-o

You must first implement cordova-background-geolocation. This plugin is an adapter for cordova-background-geolocation

Curbe8 commented 5 years ago

Firestore only.

Something in mind to migrate data from "Cloud Firestore" to "Firebase Realtime Database" in real time?

christocracy commented 5 years ago

Could you do this with Cloud Functions?

Curbe8 commented 5 years ago

I had no idea that that was possible. I will have to investigate, thank you very much!

christocracy commented 5 years ago

They’re easy and the cost is negligible since it doesn’t involve reaching outside with a network request.

Curbe8 commented 5 years ago

If it is to imagine. The api key mentioned is the one generated for cordova-background-geolocation?

christocracy commented 5 years ago

The api key mentioned is the one generated for cordova-background-geolocation?

No. This firebase adapter requires purchasing its own license key

Curbe8 commented 5 years ago

Does the version of GOOGLE_API_VERSION have to be necessarily ["16.+"] or can it be earlier?

christocracy commented 5 years ago

You should use the latest available play-services.

Curbe8 commented 5 years ago

I agree but the use of Firebase does not allow me to use that version, it generates conflicts.

christocracy commented 5 years ago

You must tell Firebase to align to the correct version. Cordova is horrible for aligning android dependencies. React Native and Flutter are much better at this. Post your platforms/android/project.properties.

christocracy commented 5 years ago

Play Services is like an extension to the OS. You never fall back to an older version "just because it works".

Curbe8 commented 5 years ago
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-plugin-background-fetch/FixBeep-build.gradle
cordova.system.library.1=com.google.android.gms:play-services-location:16.0.0
cordova.system.library.2=com.android.support:appcompat-v7:27.+
cordova.system.library.3=com.squareup.okhttp3:okhttp:3.12.+
cordova.system.library.4=org.greenrobot:eventbus:3.0.0
cordova.system.library.5=com.intentfilter:android-permissions:0.1.8
cordova.system.library.6=org.slf4j:slf4j-api:1.7.25
cordova.system.library.7=com.github.tony19:logback-android:1.3.0-2
cordova.gradle.include.2=cordova-background-geolocation/FixBeep-build.gradle
cordova.system.library.8=com.facebook.android:facebook-android-sdk:4.38.1
cordova.gradle.include.3=cordova-plugin-googlemaps/FixBeep-tbxml-android.gradle
cordova.system.library.9=com.google.android.gms:play-services-maps:16.0.0
cordova.system.library.10=com.google.android.gms:play-services-location:16.0.0
cordova.system.library.11=com.android.support:support-core-utils:27.+
cordova.system.library.12=com.android.support:support-annotations:27.+
cordova.system.library.13=com.squareup.okhttp3:okhttp:3.+
cordova.system.library.14=com.google.firebase:firebase-core:16.+
cordova.system.library.15=com.google.firebase:firebase-messaging:16.+
cordova.gradle.include.4=cordova-plugin-fcm-with-dependecy-updated/FixBeep-FCMPlugin.gradle

In fact right now there is a new version of google Play Services Location

christocracy commented 5 years ago

Your problem is with cordova-plugin-fcm-with-dependency-updated. This file was committed on Dec 12, 2018. This plugin is no longer current.

compile 'com.google.firebase:firebase-core:10.+'

Browse https://maven.google.com to see a list of all google dependencies:

Curbe8 commented 5 years ago
compile 'com.google.firebase:firebase-core:10.+'

I had no result with this change

Curbe8 commented 5 years ago

image

Curbe8 commented 5 years ago

Any recommendation? @christocracy

christocracy commented 5 years ago

Your cordova-plugin-fcm-with-dependency-updated is no longer current, using firebase-core:10.+. Latest firebase-core is 17.1.0.

cordova-plugin-fcm is one of the worst plugins. It hasn't received a commit since Jan 20, 2018 with 396 open issues. Get rid of that plugin and find an alternative or clone it and update the dependencies as required or search its network to find a fork of someone who already has.

You can add any Git repo url to cordova plugin add <any-git-url>