@spacelr/sdk 0.5.1 → 0.5.2
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.d.mts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2704,7 +2704,7 @@ var NotificationsModule = class {
|
|
|
2704
2704
|
authenticated: true
|
|
2705
2705
|
});
|
|
2706
2706
|
}
|
|
2707
|
-
/** Register a push subscription (web, android, or
|
|
2707
|
+
/** Register a push subscription (web, android, ios, or web-fcm) */
|
|
2708
2708
|
async subscribe(subscription, deviceName) {
|
|
2709
2709
|
return this.http.request({
|
|
2710
2710
|
method: "POST",
|
|
@@ -2790,6 +2790,20 @@ var NotificationsModule = class {
|
|
|
2790
2790
|
deviceName
|
|
2791
2791
|
);
|
|
2792
2792
|
}
|
|
2793
|
+
/**
|
|
2794
|
+
* Registers a web Firebase Cloud Messaging registration token (obtained via
|
|
2795
|
+
* the Firebase JS SDK `getToken()`), so `notifications.send` delivers to this
|
|
2796
|
+
* browser through the project's FCM provider instead of VAPID WebPush.
|
|
2797
|
+
*/
|
|
2798
|
+
async registerWebFcm(fcmToken, deviceName) {
|
|
2799
|
+
return this.subscribe(
|
|
2800
|
+
{
|
|
2801
|
+
platform: "web-fcm",
|
|
2802
|
+
deviceToken: fcmToken
|
|
2803
|
+
},
|
|
2804
|
+
deviceName
|
|
2805
|
+
);
|
|
2806
|
+
}
|
|
2793
2807
|
urlBase64ToUint8Array(base64String) {
|
|
2794
2808
|
const padding = "=".repeat((4 - base64String.length % 4) % 4);
|
|
2795
2809
|
const base64 = (base64String + padding).replace(/-/g, "+").replace(/_/g, "/");
|