@ccci/micro-server 1.0.115 → 1.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -250944,6 +250944,7 @@ class WebSocketServer {
|
|
|
250944
250944
|
|
|
250945
250945
|
// src/utils/PushNotifier.ts
|
|
250946
250946
|
var import_firebase_admin = __toESM(require_lib18(), 1);
|
|
250947
|
+
|
|
250947
250948
|
class PushNotifier {
|
|
250948
250949
|
static FirebaseAdmin = import_firebase_admin.default;
|
|
250949
250950
|
static instance = 0;
|
|
@@ -250957,18 +250958,20 @@ class PushNotifier {
|
|
|
250957
250958
|
credential: import_firebase_admin.default.credential.cert(FirebaseServiceAccount.default)
|
|
250958
250959
|
});
|
|
250959
250960
|
PushNotifier.instance = PushNotifier.FirebaseAdmin.app.length;
|
|
250961
|
+
PushNotifier.FirebaseAdmin.messaging().send({
|
|
250962
|
+
token: "fW3o0vp_F2iPB9qsJp0UEP:APA91bEuiMrkpSQnJi8FyvkNPJNK4uSTqBHGQ18QLufnZpl7xOC3-6-Fz938fCqX0iimTNAFpY42r2Dm0zz3ClGgOhagF9MTjYE3JwresxjfxRhe8NO-qK8UbYp8-EwDDs0PalNCMMfu",
|
|
250963
|
+
notification: { title: "Push Notification", body: "Push Notification" }
|
|
250964
|
+
});
|
|
250960
250965
|
});
|
|
250961
250966
|
}
|
|
250962
250967
|
}
|
|
250963
|
-
static async sendNotifications(tokens, message, metadata, options) {
|
|
250968
|
+
static async sendNotifications(tokens, message, metadata = {}, options) {
|
|
250964
250969
|
try {
|
|
250965
250970
|
let params = {
|
|
250966
250971
|
tokens,
|
|
250967
250972
|
notification: message,
|
|
250968
250973
|
data: metadata
|
|
250969
250974
|
};
|
|
250970
|
-
Logger.info("PushNotifier.FirebaseAdmin :>> ", PushNotifier.FirebaseAdmin);
|
|
250971
|
-
Logger.info("params :>> ", params);
|
|
250972
250975
|
let result = await PushNotifier.FirebaseAdmin.messaging().sendEachForMulticast(params);
|
|
250973
250976
|
return result;
|
|
250974
250977
|
} catch (error) {
|