Background
I'm developing an app using Firebase features (Realtime Database, Firebase Messaging, Analytics, Crash Reporting and Auth [Facebook]). In my country, most of the users don't have wifi and rarely upgrade apps (including Google Play Services).
Question
As the title suggests, I would like to know the minimum version (the lowest). I'm also willing to remove some features if it will help to lower the Google Play Services version.
Do I need to check google play service version in my application code or will Firebase check for me?
Finding so far and I'm confused,
This post say min version is 9.0
This post say min version is 8.1.15
This SO question say developer no need to check Google Play Services
but, This doc say developer need to check Google Play Services
The most trustworthy site says 9.0
For a list of the libraries available for the different Firebase features, see Firebase libraries. The following features are now part of Firebase in the Google Play Services 9.0 SDK.
The current stable is 9.4.
https://firebase.google.com/support/releases
Related
Sometimes I see lots of other location and other app version in firebase streamview? I've searched the web and SO but can't find anything also nothing in google docs? I know that when I released a new version of android app google bots install and test application but google bots appear as "Unknown Location" and also can see the version they are using. So they should't be google bots?
So, what is all that (other) things?
I was using Firebase with the following versions in my Android app project:
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
compile 'com.google.android.gms:play-services-ads:11.2.0'
compile 'com.google.android.gms:play-services-location:11.2.0'
//...
apply plugin: 'com.google.gms.google-services'
Then I updated my app to use the last version of Firebase, so replaced all 11.2.0 with 11.8.0 in all dependencies. It compiles fine, but now, when calling FirebaseAuth.getInstance().signInAnonymously(), the callback never returns and the sign in is not performed. This error is silent, but I had a look at the console, and I found:
Google Play services out of date. Requires 11910000 but found 11518438
Apparently my phone has version 11.5.18 of Google Play Services installed (thus the number 11518438). I know, updating Google Play Services should fix it, BUT, how is this supposed to work in a production environment? I'm sure there will a lot of users whose Google Play Services app will also be outdated. Does this mean that all of those users will suddenly have an app that doesn't work when they update it?
I know I can use makeGooglePlayServicesAvailable() but it just doesn't feel right (for example the user might not have Internet or space for an update). Will the user be forced to update every time a new version is needed? And, where is it documented that Firebase version X requires Google Play Services version X? I cannot see anything on Firebase release notes.
The release of new Play Services and Firebase SDKs only occurs after the Play Services APK has been made available to 100% of supported Android devices. The expectation is that these devices will self-update their Play APK. If that hasn't happened on a user's device for whatever reason, the user is typically prompted to update their Play Services before running the app that makes use of it.
A vast majority of the time, the update happens transparently and the user never knows (or needs to know) what happened. If you're withholding Play Services from your device, that is not a typical situation.
Piggybacking on what Doug said you should be checking in your app for the correct version of google play services you compiled against
GoogleApiAvailability mApiAvail = GoogleApiAvailability.getInstance();
int status = mApiAvail.isGooglePlayServicesAvailable(this);
if(status != ConnectionResult.SUCCESS){
mApiAvail.showErrorDialogFragment(this,status,1234);
}
This would show a dialog to the user saying they need to update/enable google play services.
This fixes the case where the device was not updated to the version you need.
...but it just doesn't feel right (for example the user might not have
Internet or space for an update). Will the user be forced to update
every time a new version is needed?
When you update your google play services for your app you have then declared that your app cannot function without at least that version of Google Play Services so you are forcing the user to update to be able to use your app. It is then up to the user to decide if they want to do that or not.
where is it documented that Firebase version X requires Google Play
Services version X? I cannot see anything on Firebase release notes.
Firebase is part of google play services which is why they need to be the same version
I'm using the Google Play services in my Android app so I have the dependency in my build.gradle.
compile 'com.google.android.gms:play-services:10.2.1'
But Android Studio shows a warning for it: Avoid using bundled version of Google Play services SDK.
What does this warning mean? How should I avoid it? I've googled a lot without finding much related info.
In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit. From version 6.5, you can instead selectively compile Google Play service APIs into your app
inside compile com.google.android.gms:play-services:12.0.0 contains alot of dependencies.. see below.. using play-services may cause dex problem and heavy app. Select only which want do you really depends to :)
Google Play services API Description in build.gradle
Google+ com.google.android.gms:play-services-plus:12.0.0
Google Account Login com.google.android.gms:play-services-auth:12.0.0
Google Actions,
Base Client Library com.google.android.gms:play-services-base:12.0.0
Google Address API com.google.android.gms:play-services-identity:12.0.0
Google Analytics com.google.android.gms:play-services-analytics:12.0.0
Google Awareness com.google.android.gms:play-services-awareness:12.0.0
Google Cast com.google.android.gms:play-services-cast:12.0.0
Google Cloud Messaging com.google.android.gms:play-services-gcm:12.0.0
Google Drive com.google.android.gms:play-services-drive:12.0.0
Google Fit com.google.android.gms:play-services-fitness:12.0.0
Google Location and
Activity Recognition com.google.android.gms:play-services-location:12.0.0
Google Maps com.google.android.gms:play-services-maps:12.0.0
Google Mobile Ads com.google.android.gms:play-services-ads:12.0.0
Google Places com.google.android.gms:play-services-places:12.0.0
Mobile Vision com.google.android.gms:play-services-vision:12.0.0
Google Nearby com.google.android.gms:play-services-nearby:12.0.0
Google Panorama Viewer com.google.android.gms:play-services-panorama:12.0.0
Google Play Game com.google.android.gms:play-services-games:12.0.0
SafetyNet com.google.android.gms:play-services-safetynet:12.0.0
Android Pay com.google.android.gms:play-services-wallet:12.0.0
Android Wear com.google.android.gms:play-services-wearable:12.0.0
Firebase
Firebase API Description in build.gradle
Analytics com.google.firebase:firebase-core:12.0.0
Realtime Database com.google.firebase:firebase-database:12.0.0
Cloud Firestore com.google.firebase:firebase-firestore:12.0.0
Storage com.google.firebase:firebase-storage:12.0.0
Crash Reporting com.google.firebase:firebase-crash:12.0.0
Authentication com.google.firebase:firebase-auth:12.0.0
Cloud Messaging com.google.firebase:firebase-messaging:12.0.0
Remote Config com.google.firebase:firebase-config:12.0.0
Invites and
Dynamic Links com.google.firebase:firebase-invites:12.0.0
AdMob com.google.firebase:firebase-ads:12.0.0
App Indexing com.google.firebase:firebase-appindexing:12.0.0
Performance Monitoring com.google.firebase:firebase-perf:12.0.0
EDIT
Above version is already deprecated. They use individual versioning. Please refer Link Below
Google Play Service - https://developers.google.com/android/guides/setup
Firebase - https://firebase.google.com/docs/android/setup
Google play services contain many individual APIs.
You can access whichever you require instead of accessing a bundle containing all of them. It's better approach. See Table No. 1 Here
I am developing an application and using Mobile Vision Api for text recognizing.I noticed that its not working in some devices.After searched I understand that one reason is because of google play service version that is installed on user device.So I know that I can get the version that is installed on user device like this :
int v = getPackageManager().getPackageInfo("com.google.android.gms", 0 ).versionCode;
but what is the minimum version that i have to check on user device to notice to the user to update the google play service on device(if necessary)?
I think this question is related to your post here.
There seems to be no minimum GPS version specified from the Overview of Google Play Services however it is recommended you update to the lastest as:
Google Play services gives you the freedom to use the newest APIs for
popular Google services without worrying about device support. Updates
to Google Play services are distributed automatically by the Google
Play Store and new versions of the client library are delivered
through the Android SDK Manager. This makes it easy for you to focus
on what's important: your users' experience.
The Background
My app is heavily dependent on Firebase. I use most of the services like Authentication, Realtime database, Storage, Analytics, Crash Reporting and more.
Everything works fine so far, but I have a doubt regarding a particular scenario.
The Problem
As Firebase was introduced in Play Services 9, what will happen to those devices who have still not updated to Play Services 9.
How will my app work on those devices as my app is heavily dependent on Firebase?
How does Firebase cater to the scenario of backporting?
Or should the developers some how check the version of Play Services and request the user to update?
How will my app work on those devices as my app is heavily dependent on Firebase?
When installing the application, it will prompt them a message saying that this app requires a higher version of Play Services. So it will work properly.
How does Firebase cater to the scenario of backporting?
Firebase needs a minimum API of 9. If the device doesn't support anything that's missing from the device, it will simply tell them, so you don't have to worry.
Or should the developers some how check the version of Play Services and request the user to update?
NO, Android does this for you.
i have edited my answer to make things a bit more clear
1. How will my app work on those devices as my app is heavily dependent on Firebase?
Android automatically checks for the play services version that is currently installed in the user's device and prompts the user to update to the play services version that the application was built with Firebase.
2. How does Firebase cater to the scenario of backporting?
Firebase explicitly outlines the latest version of play services as a prerequisite for building with it, there is no information on the docs about back porting so I don't think it is possible at the moment.
3. Or should the developers some how check the version of Play Services and request the user to update?
I wouldn't recommend this as Android already checks and pops up a play services error. However it is quite possible to check the version of play services and request the user to first update it in order to use your application, more info on this can be found on this link isGooglePlayServicesAvailable(Context)