FirebaseInstanceIdService is deprecated

Hope all of you aware of this class, used to get notification token whenever firebase notification token got refreshed we get the refreshed token from this class, From following method. @Override public void onTokenRefresh() { // Get updated InstanceID token. String refreshedToken = FirebaseInstanceId.getInstance().getToken(); Log.d(TAG, “Refreshed token: ” + refreshedToken); } To use this as … Read more

What is Firebase Firestore ‘Reference’ data type good for?

I’m just exploring the new Firebase Firestore and it contains a data type called reference. It is not clear to me what this does. Is it like foreign key? Can it be used to point to a collection that is located somewhere else? If reference is an actual reference, can I use it for queries? … Read more

Query based on multiple where clauses in Firebase

{ “movies”: { “movie1”: { “genre”: “comedy”, “name”: “As good as it gets”, “lead”: “Jack Nicholson” }, “movie2”: { “genre”: “Horror”, “name”: “The Shining”, “lead”: “Jack Nicholson” }, “movie3”: { “genre”: “comedy”, “name”: “The Mask”, “lead”: “Jim Carrey” } } } I am a Firebase newbie. How can I retrieve a result from the data … Read more

Firebase onMessageReceived not called when app in background

I’m working with Firebase and testing sending notifications to my app from my server while the app is in the background. The notification is sent successfully, it even appears on the notification centre of the device, but when the notification appears or even if I click on it, the onMessageReceived method inside my FCMessagingService is … Read more

API ‘variant.getExternalNativeBuildTasks()’ is obsolete and has been replaced with ‘variant.getExternalNativeBuildProviders()

Using Android Studio 3.3 Canary 11 with the gradle plugin version 3.3.0-alpha11. It throws the following error when trying to sync gradle WARNING: API ‘variant.getExternalNativeBuildTasks()’ is obsolete and has been replaced with ‘variant.getExternalNativeBuildProviders()’. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration- avoidance Affected Modules: app Clicking on the error … Read more

Convert Promise to Observable

I am trying to wrap my head around observables. I love the way observables solve development and readability issues. As I read, benefits are immense. Observables on HTTP and collections seem to be straight forward. How can I convert something like this to observable pattern. This is from my service component, to provide authentication. I’d … Read more

What’s the difference between Cloud Firestore and the Firebase Realtime Database?

Google just released Cloud Firestore, their new Document Database for apps. I have been reading the documentation but I don’t see a lot of differences between Firestore and Firebase DB. The main point is that Firestore uses documents and collections which allow the easy use of querying compared to Firebase, which is a traditional noSQL … Read more

No Firebase App ‘[DEFAULT]’ has been created – call Firebase.initializeApp() in Flutter and Firebase

I am building a Flutter application and I have integrated Firebase, but I keep getting this error when I click on a button either to register, login or logout. I have seen other people have asked the same question, but none seems to work for me. I am using Flutter and Android Studio. How can … Read more

How to handle notification when app in background in Firebase

Here is my manifest: <service android:name=”.fcm.PshycoFirebaseMessagingServices”> <intent-filter> <action android:name=”com.google.firebase.MESSAGING_EVENT” /> </intent-filter> </service> <service android:name=”.fcm.PshycoFirebaseInstanceIDService”> <intent-filter> <action android:name=”com.google.firebase.INSTANCE_ID_EVENT” /> </intent-filter> </service> When the app is in the background and a notification arrives, then the default notification comes and doesn’t run my code of onMessageReceived. Here is my onMessageReceived code. This is invoked if my app is … Read more