Unclear About This Use Case On Firebase Cloud Functions
I am working on some feature using firebase and I need to send notification to the user on this scenario:
First-> User registers a value (not unique) let's say
ABCDEFG which can also be registered by another user. So I save this in a table in
Firebase Realtime Db.
Second -> I have another table which one of the fields is the field mentioned on the first step (so relation is many to many)
Third -> Once a new record is inserted, on my second step table, I want to send notification only to users which have this
I don't really care who added the record, I just care that if that
ABCDEFG is mentioned on the table, I want to send message to the user who has this one saved.
How can I achieve this in Firebase Cloud Messaging?
Optional: I prefer not to make a login to user at all, is it doable in this case?
You can do this using Firebase Functions. Create a Trigger function that listens for data to be added to your database. In your case,
onCreate would work - when a record is created in the database, your function would then run a query to find the matching records and send out your message (email via Sendgrid, push notification, whatever).
No login needed, though you may want to consider it so you get the correct details of whomever you're sending messages to.
- → How can I query Firebase for an equalTo boolean parameter?
- → How can I access nested data in Firebase with React?
- → Firebase simple blog (confused with security rules)
- → Removing item in Firebase with React, re-render returns item undefined
- → AngularJS Unknown Provider Error (Firebase & AngularFire)
- → How do you pass top level component state down to Routes using react-router?
- → "this" is null in firebase query function in reactjs
- → Angular Module Failed to Load
- → Multiple dex files define Lcom/google/android/gms/internal/zzrx;
- → Joining Firebase tables in React
- → How can I make add firepad to my reactjs project?
- → How to use Cloud Functions for Firebase to prerender pages for SEO?
- → React.js component has null state?