I would like automate setting the APNs Authentication Key for push notifications, as well as the Team ID for an iOS App in firebase.
Therefore I would need to do this using an API (Rest, Go, Node.js, ...) Is this possible?
According to firebase support this is currently not possible. (Answer from May 2021)
Related
So i'm making an app using React JS, Cordova, node backend and a mongo database. I want to integrate firebase cloud messaging (FCM) into my platform. I'm quite new to firebase, and developing in general, and i'm not quite sure where to initialise firebase. I currently have it integrated into the front-end and it's requesting permission to receive notifications, generating tokens, and receiving messages from the firebase console. However i'm not entirely sure where to go from here. Do I add it to my backend as-well?
If you can receive messages in your client app, your front-end work is done for the moment.
But to send messages programmatically, you will need to write back-end code indeed. That's because sending messages through FCM requires that you specify the FCM server key to the API, and as its name implies that key should only be used in a trusted environment, such as your development machine, a server you control, or Cloud Functions.
For more on this, have a look at:
The architectural overview of FCM
The documentation on your server and FCM
My answer to How to send one to one message using Firebase Messaging
You have to get the FCM token from the frontend (or, client app).
After getting the token, just send it to your backend server using a POST method.
Then, store the token in whatever database you're using in your backend. It can be MongoDB, PostgreSQL, etc.
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.
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.
My website uses GCM (via OneSignal)
push notifications system.
I have to migrate push notification system to FCM (Firebase).
My goal is to migrate old tokens (and theirs relative tags/preferences) stored onto OneSignal into mine DB (on MongoDB) and send to that tokens my push notification via Firebase.
Reading Firebase's doc I don't understand if it is possible and how it is possible to reuse (or migrate/translate) old OneSignal tokens with Firebase.
Then:
Is it possible to reuse old OneSignal token with Firebase?
If n°1 is FALSE, how can I migrate old token to new token accessible with Firebase? Is there an API or JS method defined into Firebase SDK in order to translate old tokens.
I'm not familiar with how OneSignal works with GCM/FCM. What you should do is verify if the token used for OneSignal is either different or same to the actual registration token GCM works on.
The usual token format for GCM/FCM is something like this: 123456abcd:123456789abcdefghij. For a list of known characters for a GCM/FCM registration token, see here.
If it is the same, then you could simply use them as they are while proceeding to use FCM. Since FCM is still compatible with GCM tokens. However, there seems to be a really old version of GCM tokens that may be considered different from the latest format of GCM/FCM tokens (see here).
If the token is different, then unfortunately, I don't think there is a way for you to import those tokens to FCM (similar post, but for parse.com tokens). You could ask the OneSignal team if they might have the corresponding GCM tokens, but I can't say for sure.
Disclaimer: I'm no way associated or representing OneSignal in any manner.
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.