Open trongtomo opened 11 months ago
check xem xài firebase tuowng tự nv đúng k @Datnqse62453
import admin from 'firebase-admin';
import serviceAccount from 'path/to/serviceAccountKey.json'; // Replace with your service account key
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});
Khi update Regis
// ....
const newBike = await createBikeFromRegistration(registration, t);
const newOwner = await createOwnerFromRegistration(
registration,
newBike,
t
);
// Send notification to the user
const message = {
data: {
// You can customize the data payload as needed
title: 'Registration Updated',
body: 'Your registration has been updated successfully.',
},
token: associatedUser.firebaseToken, // Assuming you have a field like 'firebaseToken' in your User model
};
await admin.messaging().send(message);
// ...
@Datnqse62453 Thiếu gì add vô