When I send a notification to some topic like...
const message = {
data: { cost: 49 },
topic: 'apple'
}
admin.messaging().send(message)
Question is about preventing/filtering notifications if user set something like >= 50 ? (Firestore/localStorage?)
How can I do that?
As I can think it should be filtered with messaging-sw.js but how and it's possible?
Or any better idea or I am missing something?
Case 1: When your app is in the foreground
Case 2: When your app is in background
Anyway, using a filter on the client-side is not a good approach, it should be done in server-side