Does googleservices.json file in firebase contain any sensitive data? [duplicate] - firebase

This question already has answers here:
What does google-services.json really do?
(3 answers)
Closed 4 years ago.
I have an existing xamarin android application which uses GCM client for pushing notification using Azure Notification Hub. GCM server and client API's are deprecating on April 11,2019. Can i continue using GCM.client library with FCM server? If yes, do i need to modify the existing code
In the documentation, it is mentioned to add googleservices.json file in android application. I want to know whether file contains any sensitive data. Can i register my device with FCM using the sender ID of android project added in FCM?

You should think of google-services.json containing only public information. All of those strings get baked into your app by the gradle plugin that processes it. The protection for your app currently happens via the Google Play services app that's installed on almost all devices. That's why you're asked for your SHA-1 signing key during signup.

You can also use the existing GCM client broadcast receiver for receiving GCM push notification using the Firebase configuration. In the cloud message setting in the Firebase configuration, you could see a legacy server api key with which you can try sending push notification from GCM.
However I will recommend you to do the FCM configuration using the googleservices.json file in android application. This will not add any sensitive data and you can register your device Id using the broadcast receivers where you can get the push token.

Related

GCM to FCM migration ionic v1

I have an ionic v1 app. I've read and re-read the information about GCM to FCM migration, but I am still not 100% certain that my (unmigrated) app will still receive push notifications after April 11. I have migrated the server to FCM. I believe that the app should still work, but need it verified for certain.
Based from this link, you need to update your client code and migrate to FCM.
Existing deployed client-side apps receiving notifications will continue to work for the foreseeable future. But from mid-april, you:
won't be able to compile code using the old client-side APIs on a newer SDK/Google Play Services anymore
won't be able to call the GCM REST API to send messages anymore
To compile against the new SDK/Google Play Services, you will need to make changes to your client app to migrate to Firebase Cloud Messaging from GCM. This involves changes to the build.gradle, to AndroidManifest.xml and to your code, as described in Migrate a GCM Client App for Android to Firebase Cloud Messaging.
But aside from those changes, you don't need to get new tokens for all users. The existing tokens from GCM will continue to work.

How to create a "real" iOS push notification from Firebase topic messages if the app is not running?

As far as I understand messages on subscribed topics are received through the socket connection.
So while the app is running in the background I could create local notifications and "fake" notification that pop up on the home screen and are visible in the notification center.
But is there a way to receive topic pushes if the app is closed/not running in the background?
I'm grateful for any kind of feedback as I couldn't find any documentation regarding that specific use case.
Just to clarify: I am talking about (subscribed) topic messages in firebase NOT the firebase messages. I am used to the generic iOS push notifications handling and the involved lifecycle methods. All I need to know is how firebase topic messages can be sent via apns notifications.
With Firebase Messaging you can send notifications so the app is closed (it must be installed), basically it is configured in the AppDelegate the methods and configuration according to your need, you can see more information here Firebase Messaging
No you can’t, setup your configration in apo delegate and firebase settings, when the app is offline firebase talked directly to the APN which called the nitification center in your iphone but you don’t have access on it during the application is closed.

How to solve error "SENDER_ID_MISMATCH" error Using Firebase Cloud Messaging? [duplicate]

I have my client app with Android installed in several devices.
I also have my Server app that send messages to those apps.
The problem is that some devices receive the messages and other don't.
I get the error "MismatchSenderId" when sending the message to those devices.
I divided the problem, so I open the firebase console and send notifications to my apps (I have the Token for each of them). So, using the console app, I get errors on the same devices that using my server. But as I said, every device is using the same app.
Any help of the reason?
So to start of, I'd point out the description for MismatchSenderId error:
A registration token is tied to a certain group of senders. When a client app registers for FCM, it must specify which senders are allowed to send messages. You should use one of those sender IDs when sending messages to the client app. If you switch to a different sender, the existing registration tokens won't work.
As per our discussion, it was pointed out that you created a new Firebase Project instead of importing your Google Project that you were using for GCM. From the new project, the google-services.json was generated and used for the app, which resulted for new tokens to be associated with the new Project's Sender ID. To visualize it properly:
GCM Registration Tokens > only receive messages from > Google Project (1st)
New Tokens > only receive messages from > Firebase Project (2nd)
As a solution, I advised for you to import the Google Project to the Firebase Console, generate a google-services.json from that Project and replace the one in your app with that, which associates the app to that (correct) project. This in turn created tokens that are now associated with your 1st Project.
GCM Registration Tokens > only receive messages > Google Project (1st)
New Tokens > now receive messages > Firebase Project (2nd) Imported Google Project (1st)
Hope that makes sense.
Good to mention from the discussion:
After applying the changes, you mentioned that the error persisted, but it was a different issue that was fixed by simply using the Server Key.
Linked a post during discussion.
Supporting #AL's answer, basically you need to uninstall the app on all the devices and install the app again so that all devices receive new tokens that correspond with the newly connected firebase project database.
Need to enable the following api in the Google Console (https://console.cloud.google.com/)
Firebase Cloud Messaging API
Cloud Messaging
Then your senderId will be identified

Is Firebase client SDK necessary for simple APNS?

I have a project that currently sends PNs through APNS and I'm investigating using Firebase for this purpose. I would prefer that the push notifications be sent through APNS and Firebase merely acts as a wrapper/intermediate around APNS. I'm not using any other feature of Firebase(storage, persistent connections, messaging, etc) either.
All guides/examples on this topic seem to integrate the Firebase SDK and relevant config files but I don't see the need for any client side change if the notifications are going to go through APNS.
Do I really need the Firebase SDK for simply sending PNs? If yes, for what reason?
You only need the Firebase SDK if you intend to use the service.
The behavior of FCM, as you know it, is that when you send a message with FCM, it forwards the message towards APNs, which in turn would send it to the iOS device.
If you're already fine using APNs alone for the push notifications, then you technically don't need the Firebase SDK.

push notifications ionic 2 for android

I need to configure push notifications for an Ionic 2 application for android devices.
I read here that in order to do that you need to login to Firebase console, create a project and so on...
So my question is, do I really need to log into Firebase to do this? I'm not using firebase in my app, so I don´t get why I need to create a project to get a SERVER_ID and SERVER_KEY. What if I delete that project in Firebase afterwards, then my push notifications will stop working?
Thanks
Yes, you do need an account to use Firebase Cloud Messaging because you'll need a key to send pushs.
You need the key to use device-to-device push via HTTP and you need a project to send notifications to a group or topics.
I don't think that there's a way to use push without creating an account in any service.
You don't need a Firebase account.
You can use azure notifications hub or amazon aws or google cloud service, ionic cloud, etc.
Any cloud services that provides a notification hub which is basically a server for receiving and redistributing to the registered parties to the specific platforms.
Please note that some of these are specifically mobile oriented meaning you wont have to write any server side code and others aren't.

Resources