I am working on an App that has number of vendors providing offers and discounts on their product.
I am able to send notification but i want user to be redirected to a details page where vendor's information from firebase cloud firestore is dynamically loaded to that particular details page.
I want to know how do I send firebase collection documents with notification
i think you should send collection name as a data in notification so that when received notification you can extract collection name from data.
Related
I was developing the chat app in flutter using firestore, the users successfully chat one-to-one. but I also want to send the notification to the user that someone sends him/her a message. For that I decided to use the cloud messaging service of firebase, but how can I check that the user read the message or not.
There is nothing built into Cloud Firestore to track which user has read a specific document already.
The two most common approaches that I know of are:
To track for each individual message and each individual user whether they have read it, so by keeping a list of the user IDs in each message document. While this potentially stores a lot of extra data, it is the most direct mapping of your use-case.
In most chat apps though, tracking of what messages each user has read is done as an "up to here". So if the user has read all messages up until a certain one or a certain time, the assumption is that they've also read all the messages before that one/moment.
For this model you can instead just keep a single document ID or timestamp for each user (i.e. readUpTo), instead of having to mark each message for each user that has read it. In your UI, you then determine whether to show each message as unread based on the message ID/timestamp compared to the timestamp of readUpTo.
Using these three tools, I'm trying to think of the best way to notify a user when the other user in a chat sends them a message (using APNs).
Would it be reasonable to store (and always update to newest value) the fcm registration token as a field under the user document in firestore, then in cloud functions, create a trigger to respond to new messages being sent (where each message is a document)? Then in order to determine which device to send it to, we use the registration token field?
Is there a better way to do this?
SWIFT 3 / Firebase
app like instagram/Facebook
Notifications
I am working on letting users know when another user e.g. liked their post, made a friend request etc.
I set up everything for cloud messaging with firebase and can send bulk messages at all my devices.
Now I want to introduce notifications which contain the current user, the user who did the action and what happened.
Unfortunately I did not find anything about this despite the general implementing of firebase cloud messaging.
My questions are:
1: Do i have to structure a database (e.g. .child("notifications").child(userId).... ?
2: How do I get the token from the stranger user I address with the notification?
3: How can I make the input variable?
I am happy about all kinds of help!
I'm practicing Swift programming by trying to build Instagram for fun. I am using firebase as my database. I was able to set up the activity page where it shows a user has liked/commented on your post.
Now I am wondering how can I actually send a push notification when that happens? I tried using FirebaseMessaging but all I can really do is send messages from firebase directly.
How do I send a specific user a push notification that someone has liked their post?
You can try using Firebase functions. Here are the basic concepts:
To receive notifications, user must subscribe to a "topic" using subscribeToTopic(String topic)
Whenever a post from that topic is created, you use firebase messaging to send message to that topic
To do that, you need to host a function to firebase. That function listens to new posts being posted at whatever node you are using
Everytime a new post is written to that node, it sends the message
Here is the link to the of an example Firebase Functions Example (the function to be hosted is sendNotificationToLocation).
Check this on how to handle subscribing/unsubscribing and handling message/notification Firebase messaging
First do the all configurations for Firebase Cloud Messaging.
Then get firebase registration token of the user whom you want to send a push notifications to.
follow this link for detailed explanation
I am using parse.com to store my backend. My data is crowd sourced. So there is a chance that some material will be vulgar/spam. I want to allow the user to flag certain objects that I store in Parse so I/others can take a look at it. My idea right now is to have the user tap a button on the object in question and have that send me an email. I don't believe I can have that send me an email with some reference to that object. I know I can have the email UI pop up and they can send it that way, and that will be my last resort. But is there a way I can utilize parse and just have that button tap send some data to my parse backend, then have that send me an email with that object id in the email?
Thanks
Look at Parse's Cloud Module Guide. It has instructions on how you can use SendGrid, Mailgun, or Mandrill from cloud code to send an email whenever a new object is saved. You can use this to send yourself an email when a user creates a new "Flag".