Firebase Cloud Messaging API (V1): Server Key missing - android

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

Related

Disable app using Firebase messaging remotely?

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.

Quickblox: Unable to get push Notifications with FCM getting errr 401

I want to implement push notification in app by FCM.
The app is successfully getting FCM pushnotification but when i want to send from Quickblox admin pannel then that give me error like
error_description":"Unable to deliver notification 20860148, received error 401 (Unauthorized, check your App auth_key.)
This is log.json file :-
{"notification":{"registration_ids":["dA_lOjHQU2M:APA91bHB0zGuoalZoxtdcstBQ0dL0pPJA5HyUaoPVibD2iqnrUA51NLqrrmY5zrTZV7OaP55nUEber9NLkPs_ENkVtHLvbEAcHTrgh8wl_YoNhRsUNdyeIWt0mPDKk0tCDyLssXRuFu8"],"delay_while_idle":false,"data":{"message":"hii tesas","collapse_key":"event12616627"},"priority":"high","time_to_live":86400},"
log":[{"device_token":null,"created_at":"2016-12-14T09:56:50Z","delivered_at":null,"failed_at":"2016-12-14T09:56:51Z","error_code":401,"error_description":"Unable to deliver notification 20860148, received error 401 (Unauthorized, check your App auth_key.)"}]}
Because of GCM deprecate now so You are required to put Firebase Cloud Messaging (FCM) API Server key in your Quickblox Push notification panel go to setting and paste FCM Server key in Android-> Develpment or Production. Make sure you put Firebase Server Key there.
Follow these steps to get the server key:
Log into Firebase console https://console.firebase.google.com/
Add your project or select your project if you are already added
now click on setting icon go to project setting -> cloud messaging. there you can find your server key copy that key and paste in
There you should have your Server Key.
Hope this helps!
You are required to put Google Cloud Messaging (GCM) API key in your Quickblox Admin panel. Make sure you put Google Server Key there.
Follow these steps to get the server key:
Log into Google api console https://console.cloud.google.com/apis/
Go to "Credentials" in the navigation on the left side.
There you should have your Server Key.
Hope this helps!

Firebase Cloud Messaging using Messaging API

I found there are two ways to send Push Notifications, one is via Firebase console and second using Messaging API
I have sent Push Notifications successfully via Firebase console, but now I would like to send Push Notifications using Messaging API
But two things, I don't have an Idea, where I can find in Developer Console.
1. Authorization:key
2. "to" :
I have followed this tutorial and here is the screenshot where I have to place these two things
1. Authorization:key
The key you use for Authorization when using FCM is the Server Key found in your Firebase Console. Steps below.
Go to your Firebase Console.
Then on the left-side panel, click on the gear button (three dots) and select Project Settings.
Then go to the Cloud-Messaging Tab.
"to":
This is a payload parameter where you specify a single registration token. You may also use registration_ids instead when sending to multiple registration tokens (max of 1000).

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.

GCM - How to Generate a Server API Key For Android Push Notification

I want to use push notification service on my Android project, but when I try to generate a server key, I notice that Google's developers console changed and I can't find where I can generate my server key. I looked at a lot of tutorials but still I can't do it.
Update: There is now a visible note in the GCM docs saying:
Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.
Just retrieved a part of my answer here.
Go to your Google Developers Console
On the left-pane, click on Credentials
Under the Credentials Tab, Click on Create Credentials
Select API Key
Select Server Key
Fill out the details.
Click on Create
The Server Key should be available by then.
PS: Just tried it out, this still is a way to generate a Server Key.
please consider changing from google cloud messaging to firebase cloud messaging
google now recommend developers to use FCM instead of GCM
link here: https://firebase.google.com/features/

Categories

Resources