veta_notifications_kit_firebase 0.1.0
veta_notifications_kit_firebase: ^0.1.0 copied to clipboard
Firestore adapter for veta_notifications_kit — per-user inbox with realtime reads.
veta_notifications_kit_firebase #
Firestore adapter for veta_notifications_kit.
Per-user inbox with realtime reads.
⚠️ Firestore setup required (rules + 2 composite indexes). From your app directory:
dart run veta_firebase_setup firebase deploy --only firestore:rules,firestore:indexesSee
firebase/SETUP.md.
Usage #
await Firebase.initializeApp(options: ...);
configureVetaKits(
notifications: firebaseNotificationsStrategy(),
);
Pushing notifications (server side) #
The adapter only reads. Push from a Cloud Function or backend with the Admin SDK:
admin.firestore()
.collection('notifications').doc(userId)
.collection('items').add({
title: 'New comment',
body: 'Jane replied to your post.',
status: 'unread',
category: 'comments',
createdAt: admin.firestore.FieldValue.serverTimestamp(),
});
For native push, pair with firebase_messaging independently — this kit
is just the inbox.