Using firebase cloud messaging in a device without Google Play Services - android

I'm developing an app that will run in a android device that doesn't have google Play Store, and Google Play services.
I need to use the firebase CM in my app. Is there any way to include the plugin inside my APK (is not going to be distributed outside those devices) so the service works properly?

Yet, there is no official or announced support for using Firebase without Google Play.. Some Firebase dependencies like Realtime database may work but not recommended from Firebase

Related

Which firebase services require google play services on Android?

I'm working on a project where we have an Android tablet that cannot have google play services installed on it. Which features/services of firebase have a dependency on google play services to run?
Specifically I'm looking at real-time database, authentication, firestore, and firebase cloud messaging.
I spoke with a developer advocate that said that real-time database doesn't have that dependency, but I couldn't find any official documentation that states that.
firebaser here
Some Firebase products require Google Play Services, while others don't. Information on this is nowadays included in the Firebase documentation, so I recommend checking out dependencies of Firebase Android SDKs on Google Play services for the latest list.
You can see it from the documentation.
https://firebase.google.com/docs/android/android-play-services
I managed to run my app after migrating to non play services Firebase Auth, while the database and storage continue to work fine.
Google Pay service can basically installed apps in its sore onto the device, if you cannot use this you would need to make the app as a "progressive web app" instead then. https://developers.google.com/web/progressive-web-apps/
Effectively what you can do through a webpage, using firebase hosting/firebaseDB/storage you would want to simply install a npm i -g firebase-tools do a firebase init in your project folder and configure your firebase settings to use your apps distribution folder for AnglularCLI the public folder would be "dist"
with the old versioning, play-services-base and play-services-auth were required; eg. to use FirebaseAuth with a Google account. the documentation only states firebase-core (checked that yesterday, because of a similar dependency question). but most likely, the "Login with Google" auth-provider might not be available then - and you would have to offer alternate ways to register an account.

How to suppress the "Avoid using bundled version of Google Play services SDK" warning?

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

Firebase for Play Services below 9

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)

Google Cloud Messaging on a non-PlayStore App

Working on a device-owner application (installed at provision time with NFC), so far I did not find any way to provision devices directly with a PlayStore-based-App, that is why I keep using a private distribution mode for my apk, directly downloaded from a private server...
In this context here is my question: is there a way to use GCM with an App that isn't distributed on the Google Play Store?
Developers will be able to sign-up for GCM for both Play and non-Play apps. However, GCM stats will be available for only published Google Play apps. So yes, I believe you can use GCM with a non-Play Store app.

Android GCM account necessary for each device?

Im working on an app with server-client communication. It will have a small
messaging system and maybe i will also synchronize the conigurations with GCM.
All users have to register to use the app and to use the functionalities
from our provided website and they can communicate with other registered user
using the app or the website.
If i use GCM to implement the messaging and the config synchronization, does
every user has to have a google account? This Tutorial says that i have
to create a google account. That wouldnt be good for me.. actually i dont want
my users to be forced to have a google account.
From Android GCM Overview
It uses an existing connection for Google services. For pre-3.0 devices, this requires users to set up their Google account on their mobile devices. A Google account is not a requirement on devices running Android 4.0.4 or higher.
If you are using GCM from the google play service library yes you need a google account because google play services gets updated through the play store.

Categories

Resources