Vectras-VM-Android/js/push_notification.js
An Bui 4c153ed129 3.9.1
- Firebase Crashlytics has been added back.
- Notifications have been improved.
- Viewing in the An Bui app has been added to supported content in the Rom store.
2026-03-29 00:02:21 +07:00

27 lines
No EOL
766 B
JavaScript

import admin from "firebase-admin";
import serviceAccount from './*-*-firebase-adminsdk-*-*.json' with { type: 'json' };
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});
async function sendNotification() {
try {
const res = await admin.messaging().send({
data: {
title: "Vectras VM",
message: "Welcome!",
image: "https://github.com/xoureldeen/Vectras-VM-Android/blob/master/resources/vectrasvm.png",
url : "https://github.com/xoureldeen/Vectras-VM-Android",
//targetVersions: "3.9.0,3.9.1"
targetVersions: ""
},
topic: "vectrasvmandroidgithub"
});
console.log("Sent:", res);
} catch (err) {
console.error("Error:", err);
}
}
sendNotification();