FCM | ️ PushNotifications through FireBase for Vapor | Web Framework library
kandi X-RAY | FCM Summary
kandi X-RAY | FCM Summary
⚡️ PushNotifications through FireBase for Vapor 3 and 4.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of FCM
FCM Key Features
FCM Examples and Code Snippets
Community Discussions
Trending Discussions on FCM
QUESTION
I tried every possible solution on the internet with no hope
What I am trying to do is simply use aws lambda functions (through the aws console) to fetch user fcm token from lets say DynamoDB (not included in the question), use that token to create endpointArn, send push to that specific device
I tested to send Using SNS console and the push gets to the device successfully but I failed to get it to the device using Lambda functions although it gives success status and message ID
Here is the code I used
...ANSWER
Answered 2021-Jun-12 at 09:43After some trials and errors I figured out the solution for my own question
1- The GCM part of the payload should be a string not a json 2- The message parameter should have an attribute that explicitly sets the mime type of the payload to Json
Taking all that into consideration
QUESTION
I want to localize notification , and i find that there is properties for that , like title_loc_key, body_loc_key
he FCM fields used for localizing (I18N) the notification title and body are not working. For example:
...ANSWER
Answered 2021-Jun-10 at 11:47FCM isn't aware of Flutter. It focuses on the native apps. So for Flutter, this would be the code within the android
and ios
directories.
If you want to use title_loc_key
and body_loc_key
, you'll have to add labels to android/app/src/main/res/values/strings.xml
on Android. Those are separate from the labels you use within your Flutter code.
QUESTION
Currently I am Configuring FCM for my Flutter application, everything is working fine on android side, however in order to configure FCM in iOS I need an Apple developer account membership which I currently don't have access to.
when building the iOS app it gives the following Error
No profiles for 'app Bundle Id' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'app Bundle Id'.
Is it possible to build the flutter application on iOS to continue to make other features without configuring the FCM ?
...ANSWER
Answered 2021-Feb-19 at 12:55In order to be able to use things like Push Notifications, in app etc on iOS you need to have a paid Developer account. So you will not be able to use FCM with the "free / testing" signing.
Without a paid Developer account, xcode can't generate the proper provisioning profile to make your app work.
QUESTION
We are running 2 separate Google Cloud Projects, Project A and Project B.
Project A is currently running an App Engine (AE) based API.
The API on project A needs to access the Firebase features on project B.
✅ I have setup cross projects access between the two projects using IAM and most functions are working fine.
App Engine on project A is able to access the Firebase real time db (RTDB) and Firebase Auth functions on Project B.
But we are unable to connect to Firebase Cloud Messaging on Project B
As far as I can see tracing through the Firebase admin SDK calls, we are able to obtain access tokens, and they're all valid as we can use some of the services (i.e. RTDB, Auth)
However, when we try using Firebase Cloud messaging we receive the following error: An error occurred when trying to authenticate to the FCM servers. Make sure the credential used to authenticate this SDK has the proper permissions.
Which seems to originate from a 401 unauthorized response to this service https://iid.googleapis.com/iid/v1:batchAdd
It doesn't seem to matter what amount of Roles on Project B I throw at the Project A service account.
If I use a separate Firebase service account that originated from Project B and use that json file as a credential then the issue go away, but I don't want to distribute credential files around, and everything else work fine without, except FCM.
FWIW this is how i initialise the firebase admin sdk
...ANSWER
Answered 2021-Jun-08 at 04:53So in the case of Real time database, you only need to give Firebase Realtime Database Admin role to the Project A's App Engine service account on Project B.
In Firebase Cloud Messaging you can give Firebase Cloud Messaging Admin role on Project B AND the cloudmessaging.messages.create
permission to the service account on Project A.
This will go around the initial 401 unauthorised response from messaging calls.
However, this will still result in an error, this time NOT FOUND, which indicates that the subscription token was not found.
It seems that calls to FCM don't use the projectId
setting in firebase admin initialisation and always execute against the project the service account was created in (Project A in this case).
I haven't been able to find a way for FCM calls to executed in the specified projectId
scope from another project.
QUESTION
i have a problem. I cannot use OneSignal. I don't know why. I googled the error but nothing helped.
Currently i use Android Studio on Version: 4.2 The newest OneSignal Version: 4.3.4 And also the newest Firebase Version. I created a new Firebase Project and OneSignal Project.
This is the Error:
...ANSWER
Answered 2021-May-26 at 07:52The class com.google.firebase.iid.FirebaseInstanceId has been deprecated and removed from the latest versions of the aar:
QUESTION
I am trying to use latest FCM using firebase_messaging: ^10.0.1 in my pubspec.yaml
from the documentation in here , I have to create a Application file in the Android project folder. from that documentation, the code is still in Java, I copy and paste that java code so the Android Studio will convert it automatically to Kotlin , the result is like this
in my Application.kt
ANSWER
Answered 2021-Jun-07 at 05:07This should be the right implementation
QUESTION
I want to build a notification system in my Android app where I can send a notification to someone upon an event. For example, my app is about a social system where it uses Firestore database (Firebase) to save its users (which means I have a 'users' collection in there), and I have an 'Add as Friend' feature.
Everything works just fine, but I would like to add a feature where when user1
adds user2
as a friend, I would like to send user2
a notification about that.
I have searched in google and saw this post: https://www.geeksforgeeks.org/how-to-push-notification-in-android-using-firebase-cloud-messaging/
Now, from what I understand, this wouldn't help me much cause it only sends the notification from FCM by me (and not to a specific user).
The problem is, I don't really know what to search for (or what to type in google) in order to find what I'm looking for.
Some ideas I thought:
- to make a collection in firestore called 'Notifications' where it holds usernames as documentIDs
- when
user1
sends a friend request touser2
, I would add data (like title/message) to 'Notifications/user2/'
But I'm kind of stuck here, I would like to know ideas or if you guys have threads on how do I implement this, I really don't know what should I look for.
Thank you very much and sorry for the long post.
...ANSWER
Answered 2021-Jun-06 at 22:59Firebase creates a userID for every user and a usertoken which is a temporary identifier for the device which is connected to this userID. You need to save the usertoken when there is a new one being created in a database(firestore) along with the user with whom you identify this person.
When someone adds this person as a friend you can add a notification in the database that there is a request from person1 to person2. This change in the database can trigger a cloud function that reacts to changes in the database.
The triggered cloud function sends an FCM to the person which is being added as a friend. This FCM can either be a pure notification or you send data and let your app handle how this data is being handled(saved in a local database or displayed as a custom notification).
Keywords are: FCM, Notification, Firestore, cloud functions, and firebase token
Edit (Answer to 1. comment): Firebase userID and usertoken are created on the device. In the tutorial you implement FCM(I didn't read it complete) and a class called FirebaseMessagingService, from which you can inherit. This class is called, when a message is sent to the device and contains a method called onNewToken. This message is called, when the Firebase Server creates a token for your device and sends it to the device. In this method you might want to send the new token to your database and save it as an identifier for the user of this device. The Tokens are used by firebase to identify devices, to which messages are being sent(You can read about FCM in detail)
Cloud functions are something you can deploy along your firebase project, which get triggered when an event occurs. For example a http call, or a specific change in your database. Cloud functions are written in JS and need to be deployed for your firebase project. (Cloud functions are not for free and you need to pay for each call, but you have some thousand uses for free each month.)
You send a FCM to a specific person by creating a firebase message which is directed to a specific token, tokens or user groups. To identify the person to which you want to send a message you need to have the token for this user, that is why you are saving the tokens from the 1. part in your database and always update the token, when the token changes on the device.
Keep in mind, that a user might use multiple devices. You should have an identifier for you, such as username and along this username you save multiple firebaseIds and Firebase tokens. A single FCM can be directed to up to 100 tokens.
QUESTION
I am new to react native and I am stuck to send push notification from client side. i have FCM token of every user but need to send a notification to specific user. if you want more clarity please comment and let me know the solution of this
...ANSWER
Answered 2021-Jun-05 at 06:05I saw your problem and I have a solution for you. I am already doing it and here's my code.
QUESTION
My apps needs a VOIP call functionality and I use webRTC to achieve it. In webRTC how the reciever knows about the incoming call?
All my users will register in Django and flutter as a frontend. If I use FCM how can specify the exact user to send notifcation. Some articles suggest to use UID, email and such things if I have been authenticated with the firebase I might know about the UID but I use my own server How to make this possible?
In case if we use email to send a notification i.e., will firebase send the notification to the particular user?
...ANSWER
Answered 2021-Jun-02 at 06:18Use firebase cloud messaging. If you are using Django or whatever server for the backend you just have to get the user's fcm token while user registers from the app. And in your database store the user's email with that token. So whenever you want to send a notification to a specific user you can trigger by their respective fcm token.
Use below code to get user's token in flutterfire.
QUESTION
My app needs a functionality of internet call so I planned to use webRTC and using firebase as signalling server.
In this feature caller is interested in calling the callee. But in webRTC the user needs to use the code to answer the call by send sdp and ice candidate.
But the problem for me is how to notify the user about the incoming offer call. Can I use FCM for notifying the user?
What are the other ways of notifying the user?
...ANSWER
Answered 2021-Jun-01 at 15:17As you are already using firestore or firebase real-time database as a signaling medium you should use firebase cloud messaging to notify users about the calls.
You can yous firebase cloud functions for the same. Where by detecting changes in the database you can send notifications to users.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install FCM
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page