@ccci/micro-server 1.0.116 → 1.0.118
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 +12 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -250958,24 +250958,24 @@ class PushNotifier {
|
|
|
250958
250958
|
credential: import_firebase_admin.default.credential.cert(FirebaseServiceAccount.default)
|
|
250959
250959
|
});
|
|
250960
250960
|
PushNotifier.instance = PushNotifier.FirebaseAdmin.app.length;
|
|
250961
|
-
PushNotifier.FirebaseAdmin.messaging().
|
|
250962
|
-
|
|
250963
|
-
notification: {
|
|
250964
|
-
title: "Test Nofitication",
|
|
250965
|
-
body: "Hello from notifier"
|
|
250966
|
-
}
|
|
250961
|
+
PushNotifier.FirebaseAdmin.messaging().send({
|
|
250962
|
+
token: "fW3o0vp_F2iPB9qsJp0UEP:APA91bEuiMrkpSQnJi8FyvkNPJNK4uSTqBHGQ18QLufnZpl7xOC3-6-Fz938fCqX0iimTNAFpY42r2Dm0zz3ClGgOhagF9MTjYE3JwresxjfxRhe8NO-qK8UbYp8-EwDDs0PalNCMMfu",
|
|
250963
|
+
notification: { title: "Push Notification", body: "Push Notification" }
|
|
250967
250964
|
});
|
|
250968
250965
|
});
|
|
250969
250966
|
}
|
|
250970
250967
|
}
|
|
250971
250968
|
static async sendNotifications(tokens, message, metadata = {}, options) {
|
|
250972
250969
|
try {
|
|
250973
|
-
let params =
|
|
250974
|
-
|
|
250975
|
-
|
|
250976
|
-
|
|
250977
|
-
|
|
250978
|
-
|
|
250970
|
+
let params = [];
|
|
250971
|
+
tokens.forEach((token) => {
|
|
250972
|
+
params.push({
|
|
250973
|
+
token,
|
|
250974
|
+
notification: message,
|
|
250975
|
+
data: metadata
|
|
250976
|
+
});
|
|
250977
|
+
});
|
|
250978
|
+
let result = await PushNotifier.FirebaseAdmin.messaging().sendEach(params);
|
|
250979
250979
|
return result;
|
|
250980
250980
|
} catch (error) {
|
|
250981
250981
|
console.log("error :>> ", error);
|