valtech-components 2.0.753 → 2.0.755
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/esm2022/lib/components/molecules/username-input/username-input.component.mjs +3 -3
- package/esm2022/lib/services/firebase/messaging.service.mjs +14 -30
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +16 -32
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/services/firebase/messaging.service.d.ts +16 -12
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -62,20 +62,24 @@ export declare class MessagingService {
|
|
|
62
62
|
private readonly DEBUG_STORAGE_KEY;
|
|
63
63
|
constructor(injector: Injector, config: ValtechFirebaseConfig, platformId: Object, ngZone: NgZone);
|
|
64
64
|
/**
|
|
65
|
-
* Obtiene la instancia de Messaging
|
|
66
|
-
* Esto evita el error de APP_INITIALIZER de AngularFire.
|
|
67
|
-
*/
|
|
68
|
-
/**
|
|
69
|
-
* Obtiene la instancia de Messaging de forma async-safe.
|
|
65
|
+
* Obtiene la instancia de Messaging via Firebase SDK directo (NO AngularFire DI).
|
|
70
66
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
67
|
+
* **Por qué no usamos `injector.get(Messaging)`:**
|
|
68
|
+
* AngularFire `provideMessaging` registra un APP_INITIALIZER que internamente
|
|
69
|
+
* resuelve `await isSupported()`. Si `injector.get(Messaging)` se llama antes
|
|
70
|
+
* que ese APP_INITIALIZER termine (ej. otros APP_INITIALIZER del cliente
|
|
71
|
+
* construyen AuthService → MessagingService → toca Messaging temprano),
|
|
72
|
+
* AngularFire lanza el error "APP_INITIALIZER ... has not resolved". Angular
|
|
73
|
+
* DI **cachea errores de factory** — una vez que falló, todos los
|
|
74
|
+
* `injector.get` siguientes retornan el mismo error cacheado. Retry loops
|
|
75
|
+
* no funcionan.
|
|
75
76
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
77
|
+
* **Workaround:** bypass AngularFire entirely y usar Firebase SDK directo
|
|
78
|
+
* (`firebase/messaging.getMessaging(getApp())`). AngularFire es un wrapper
|
|
79
|
+
* sobre el mismo SDK — la instancia que obtenemos es funcionalmente idéntica.
|
|
80
|
+
* `getApp()` retorna la default Firebase app inicializada por
|
|
81
|
+
* `provideFirebaseApp(() => initializeApp(config.firebase))`. Si por alguna
|
|
82
|
+
* razón no está inicializada aún, hacemos initializeApp idempotente.
|
|
79
83
|
*/
|
|
80
84
|
private fcmSupportPromise?;
|
|
81
85
|
private getMessagingInstance;
|
package/lib/version.d.ts
CHANGED