@burdenoff/fe-libs 2026.1012.2 → 2026.1012.3
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.
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* appName: 'VibeControls',
|
|
16
16
|
* plugins: {
|
|
17
17
|
* updater: () => import('@capgo/capacitor-updater'),
|
|
18
|
-
* pushNotifications: () => import('@capacitor/
|
|
18
|
+
* pushNotifications: () => import('@capacitor-firebase/messaging'),
|
|
19
19
|
* },
|
|
20
20
|
* push: { enabled: true },
|
|
21
21
|
* });
|
|
@@ -15,7 +15,7 @@ async function s() {
|
|
|
15
15
|
if (a) return a;
|
|
16
16
|
if (!o || !t()) return null;
|
|
17
17
|
try {
|
|
18
|
-
a = (await o()).
|
|
18
|
+
a = (await o()).FirebaseMessaging ?? null;
|
|
19
19
|
} catch {
|
|
20
20
|
a = null;
|
|
21
21
|
}
|
|
@@ -41,24 +41,27 @@ async function l(t, r = {}) {
|
|
|
41
41
|
if (!l) return;
|
|
42
42
|
let u = e();
|
|
43
43
|
if (u !== "web") try {
|
|
44
|
-
await l.addListener("
|
|
45
|
-
i(e.
|
|
46
|
-
}), await l.addListener("
|
|
47
|
-
|
|
48
|
-
}), await l.addListener("
|
|
49
|
-
r.onNotificationReceived?.(e);
|
|
50
|
-
}), await l.addListener("pushNotificationActionPerformed", (e) => {
|
|
44
|
+
if (await l.addListener("tokenReceived", (e) => {
|
|
45
|
+
i(e.token, u), r.onToken?.(e.token, u);
|
|
46
|
+
}), await l.addListener("notificationReceived", (e) => {
|
|
47
|
+
r.onNotificationReceived?.(e.notification);
|
|
48
|
+
}), await l.addListener("notificationActionPerformed", (e) => {
|
|
51
49
|
let t = c(e);
|
|
52
50
|
t && n(t), r.onNotificationAction?.(e);
|
|
53
|
-
}), (await l.checkPermissions()).receive === "granted"
|
|
51
|
+
}), (await l.checkPermissions()).receive === "granted") {
|
|
52
|
+
let { token: e } = await l.getToken();
|
|
53
|
+
i(e, u), r.onToken?.(e, u);
|
|
54
|
+
}
|
|
54
55
|
} catch {}
|
|
55
56
|
}
|
|
56
57
|
async function u() {
|
|
57
|
-
let
|
|
58
|
-
if (!
|
|
58
|
+
let t = await s();
|
|
59
|
+
if (!t) return !1;
|
|
59
60
|
try {
|
|
60
|
-
let
|
|
61
|
-
|
|
61
|
+
let n = await t.checkPermissions();
|
|
62
|
+
if ((n.receive === "prompt" || n.receive === "prompt-with-rationale") && (n = await t.requestPermissions()), n.receive !== "granted") return !1;
|
|
63
|
+
let { token: r } = await t.getToken();
|
|
64
|
+
return i(r, e()), !0;
|
|
62
65
|
} catch {
|
|
63
66
|
return !1;
|
|
64
67
|
}
|
|
@@ -161,7 +161,7 @@ export interface CapacitorUpdaterLike {
|
|
|
161
161
|
notifyAppReady(): Promise<unknown>;
|
|
162
162
|
}
|
|
163
163
|
export interface PushTokenLike {
|
|
164
|
-
|
|
164
|
+
token: string;
|
|
165
165
|
}
|
|
166
166
|
export interface PushNotificationSchemaLike {
|
|
167
167
|
id?: string;
|
|
@@ -171,10 +171,19 @@ export interface PushNotificationSchemaLike {
|
|
|
171
171
|
}
|
|
172
172
|
export interface PushActionPerformedLike {
|
|
173
173
|
actionId?: string;
|
|
174
|
+
inputValue?: string;
|
|
174
175
|
notification: PushNotificationSchemaLike;
|
|
175
176
|
}
|
|
176
177
|
export type PushPermissionStateLike = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';
|
|
177
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* Structural subset of `@capacitor-firebase/messaging`'s `FirebaseMessaging`.
|
|
180
|
+
*
|
|
181
|
+
* Not `@capacitor/push-notifications`: on iOS that plugin's `register()` /
|
|
182
|
+
* `'registration'` event yields the raw APNs device token, not an FCM
|
|
183
|
+
* registration token — our backend (Firebase Admin SDK, FCM HTTP v1) needs the
|
|
184
|
+
* latter. `FirebaseMessaging` does the APNs→FCM exchange natively and hands
|
|
185
|
+
* back one consistent token shape on both platforms via `getToken()`.
|
|
186
|
+
*/
|
|
178
187
|
export interface PushNotificationsLike {
|
|
179
188
|
checkPermissions(): Promise<{
|
|
180
189
|
receive: PushPermissionStateLike;
|
|
@@ -182,24 +191,25 @@ export interface PushNotificationsLike {
|
|
|
182
191
|
requestPermissions(): Promise<{
|
|
183
192
|
receive: PushPermissionStateLike;
|
|
184
193
|
}>;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
194
|
+
getToken(): Promise<{
|
|
195
|
+
token: string;
|
|
196
|
+
}>;
|
|
197
|
+
addListener(eventName: 'tokenReceived', listener: (token: PushTokenLike) => void): Promise<CapacitorListenerHandleLike>;
|
|
198
|
+
addListener(eventName: 'notificationReceived', listener: (event: {
|
|
199
|
+
notification: PushNotificationSchemaLike;
|
|
189
200
|
}) => void): Promise<CapacitorListenerHandleLike>;
|
|
190
|
-
addListener(eventName: '
|
|
191
|
-
addListener(eventName: 'pushNotificationActionPerformed', listener: (action: PushActionPerformedLike) => void): Promise<CapacitorListenerHandleLike>;
|
|
201
|
+
addListener(eventName: 'notificationActionPerformed', listener: (action: PushActionPerformedLike) => void): Promise<CapacitorListenerHandleLike>;
|
|
192
202
|
}
|
|
193
203
|
export type UpdaterLoader = () => Promise<{
|
|
194
204
|
CapacitorUpdater: CapacitorUpdaterLike;
|
|
195
205
|
}>;
|
|
196
206
|
export type PushNotificationsLoader = () => Promise<{
|
|
197
|
-
|
|
207
|
+
FirebaseMessaging: PushNotificationsLike;
|
|
198
208
|
}>;
|
|
199
209
|
export interface OptionalPluginLoaders {
|
|
200
210
|
/** `() => import('@capgo/capacitor-updater')` */
|
|
201
211
|
updater?: UpdaterLoader;
|
|
202
|
-
/** `() => import('@capacitor/
|
|
212
|
+
/** `() => import('@capacitor-firebase/messaging')` */
|
|
203
213
|
pushNotifications?: PushNotificationsLoader;
|
|
204
214
|
}
|
|
205
215
|
export interface PushOptions {
|