Disable app using Firebase messaging remotely? - android

I want to stop all Firebase Cloud Messaging functionality from my app completely. How can I do it? Does removing the Firebase project prevent the app from using all the Firebase Messaging related functionality? I tried disabling the Firebase Cloud Messaging API from Google's API console but it reenables itself automatically next I sent push notification using Firebase Cloud Messaging.
I just want to disable all Firebase Cloud Messaging related functionality from all versions of my app without creating another APK.

if you want to stop all the servcices of firebse in your running app there are 2 ways to stop them ;-
1) remove all the SHA from firebase console.
2) Delete your firebase project from firebase console.

Related

Firebase Cloud Messaging API (V1): Server Key missing

We're using Urban Airship to send push messages to our Android app.
In that process, we need to configure Airship with 'Server Key' provided in Firebase Console -> Cloud Messaging.
As recommended there, we are trying to migrate from GCM to FCM.
The problem is that 'Server Key' is missing in 'Firebase Cloud Messaging API (V1)' configuration.
It is still available in 'Cloud Messaging API (Legacy)' configuration, but migration is suggested.
Following the links in FCM configuration didn't help too much with this issue.
To access the server key:
Open Project Settings as you already did
Open the Firebase Cloud Messaging API menu (to the right of the Enabled)
Click on Manage API in Google Cloud Console, it will redirect you to Google Cloud Platform
In Google Cloud Platform, you will get Firebase Cloud Messaging API, click on Manage. It will redirect you to APIs & Services
Click on Credentials (on the left side of the screen)
There you will get different tables. One is called API Keys and inside you will see an entry called Server Key
Click on Show Key, and you will get what you want
I hope this will help you
Firebase cloud messaging is now shifted to API (V1)
So to get the serverkey you should enable the cloud messaging API (Legacy).
Follow the steps:
Click on the three dots and click on manage Api in google cloud console
Click on enable.
3.Now redirect back to the main page and refresh the page.
Now you have your serverkey
Hope it helps!
Reference: https://stackoverflow.com/a/72719766/13431819
From Firebase Cloud Messaging API (V1), we have to enable the cloud messaging service.
Open project settings
Select three dot menu right to Cloud Messaging API (Legacy) and tap Manage API in Google Cloud Console
In the redirected Google Cloud Console enable the cloud messaging service.
Go back to project settings and refresh. You can get the server key now.
Reference - https://documentation.onesignal.com/docs/generate-a-google-server-api-key

Using local app to test Push Notification [duplicate]

This question already has answers here:
Where can I find the API KEY for Firebase Cloud Messaging?
(12 answers)
Closed 4 years ago.
I am very new in both Android Development and fcm. I have been building a mobile app, and I want to use Firebase Cloud Messaging
to push notifications to particular users(by making them subscribing to different topics). I've already created a Java Server (apart from the mobile app) but I could not figure out how to test it on my application because I don't know how to find fcm key for my application if there is any. Is there a way to test my server locally or is it obligated to have an application registered to Google Firebase? Any help would be appreciated, thanks in advance.
Yes you can.
The FCM API key (Server Key) can be found in the firebase console under your project :
Project Settings > Cloud Messaging
Is there a way to test my server locally or is it obligated to have an application registered to Google Firebase?
You definitely need to register your application to firebase to use FCM and get the key.
I could not figure out how to test it on my application because I don't know how to find fcm key for my application if there is any.
After you register your app to firebase and link it to your Android studio project,
(https://firebase.google.com/docs/android/setup)
Go to your project settings in firebase,
In your project settings, click on Cloud Messaging, the Server Key is your FCM KEY
Follow this to send message from your server to device. You can also use firebase console to do that,
How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

GCM without using Firebase

Is it OK to use GCM without involving Firebase?
As I saw from Google(https://developers.google.com/cloud-messaging/android/client) that, "New Cloud Messaging projects must create a Firebase project". Is it true?
TL;DR: Yes. You could still use the service without (technically) using Firebase.
Google Cloud Messaging is the old version for Firebase Cloud Messaging. During that time, it was only required to create a Google Developer Project in order to use the service.
GCM has since become part of Firebase and was rebranded as Firebase Cloud Messaging. Although the name adds in Firebase, FCM is still a service on it's own, where most of what it is right now, is still based from the old version (of course there are a lot of new stuff by now, but you get what I mean) -- in which case you can still use the service without using the other Firebase services.
Creating a Firebase Project doesn't mean you would have to use or it counts as using the other Firebase services. It's just the place where you would see most of the data related to your FCM service.
All users, even the old GCM users, are currently (strongly) encouraged to actually import their projects to Firebase Console.

Facebook App Analytics Push Campaigns using Firebase Cloud Messaging

I am trying to integrate Facebook app analytics push campaign into android/iOS app.
We have already got a custom push mechanism using Firebase Messaging.
Going through the the set up steps to set up push campaings (https://developers.facebook.com/docs/analytics/push-campaigns/android)
I see that it requires app to use GCM.
Is it possible to configure Facebook app analytics push campaign & in app notification features using Firebase Messaging ?
You can use FCM for Facebook app analytics push campaign. Enter the same Server Key of your App(FCM Console -> Project Settings) to Facebook Analytics Settings Page under API Key.
Follow the same instructions for App,
https://developers.facebook.com/docs/analytics/push-campaigns/android
You can also test if the push notifications delivers fine in Facebook Analytics page Event Debug section.
For Inapp Notification you have to add the following to your gradle dependencies:
compile 'com.facebook.android:notifications:1.+'
https://github.com/facebook/FBNotifications
Absolutely. In fact, you need Firebase Cloud Messaging in order to configure Facebook Push Notifications. If you see the content of the link https://developers.facebook.com/docs/push-notifications/quickstart, notice how under the heading "In-App Notifications", it says: "Prior to sending in-app notifications you will also need to integrate the FBNotifications library." Then if you go to https://github.com/facebook/FBNotifications, you will see that under the heading "Getting Started on Android", it says: "After you've added the dependency, you'll have to set up an FCM listener service,..." It is asking you to set up an FCM listener service and providing this link which contains the instructions to configure Firebase Cloud Messaging: https://firebase.google.com/docs/cloud-messaging/android/client.
Conclusion: Firebase Cloud Messaging is not an option if you want to configure Facebook Analytics Push Campaigns. It is required. Firebase Cloud Messaging can operate without Facebook Analytics Push Campaigns, but not vice versa.

Azure Notification Hub no longer accepting GCM API Key

Recently, every time I try to add or modify the GCM API Key in an Azure Notification Hub, I get the following error:
SubCode=40000. Failed to validate credentials with GCM. The remote
server returned an error: (401) Unauthorized...
I have tried using the same key that works in other Notification Hubs, as well as creating a new one via the Google Developer's console.
I've also recently come across articles stating that GCM is moving to FCM (Firebase Cloud Messaging). Could this be the cause of my issue? Is Google beginning to no longer support GCM?
There are two important informations:
Firebase Cloud Messaging (FCM) is the new version of GCM
So we should prefer Firebase Console instead of Google Cloud Console,
There is a useful article here Enabling Google Cloud Messaging (Firebase)
So we need to enable Google Cloud Messaging in Firebase Console for your added Android App.
Step by step:
-- Open your Firebase Console
-- Add your Android app in Firebase Console.
-- Go to Settings
-- Click CLOUD MESSAGING tab.
-- Take Legacy Server key there and use it in Azure Push Notification Service for Google(GCM) settings and Save it. That's all.
This article helps you how to create a Notification Hub Service in Azure then how to connect your Android or IOS App to Firebase Console etc.
Could you make sure that 1) you have enabled Google Cloud Messaging for Android in your cloud push account and 2) you are creating a new Server Key?
Also, use try sending a push notification from the command line to validate that the key is working with GCM directly. If that works, then Azure portal should accept the key. If that's not the case, please leave a comment.

Categories

Resources