@rivium/push-web 0.1.8 → 0.1.10

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.ts CHANGED
@@ -466,6 +466,20 @@ declare class RiviumPush {
466
466
  * Unsubscribe from a topic
467
467
  */
468
468
  unsubscribeTopic(topic: string): Promise<void>;
469
+ /**
470
+ * Show an OS notification for a message the app received while its page was
471
+ * visible.
472
+ *
473
+ * A message that arrives over the real-time connection is handed to
474
+ * `onMessage` and, while the page is visible, deliberately not shown as an
475
+ * OS notification - the app is in front and usually shows its own UI. Some
476
+ * messages still deserve one: a chat message for a conversation the user is
477
+ * not reading, for instance. The app knows that; the SDK does not.
478
+ *
479
+ * Goes through the service worker when there is one, so clicks are handled
480
+ * the same way as a notification the worker showed itself.
481
+ */
482
+ showNotification(message: RiviumPushMessage): void;
469
483
  /**
470
484
  * Check if connected to MQTT broker
471
485
  */
@@ -649,6 +663,19 @@ declare class RiviumPush {
649
663
  private showRichNotification;
650
664
  private updateFaviconBadge;
651
665
  private setConnectionState;
666
+ /**
667
+ * The id the BACKEND uses in MQTT topics: the first 16 characters of the
668
+ * project id, returned as `appId` by /devices/register.
669
+ *
670
+ * Channels were built from the API key prefix instead, so every channel this
671
+ * SDK streamed from was one nothing is ever published to - the real-time
672
+ * path silently delivered nothing on web, from 0.1.0 until 0.1.9. It went
673
+ * unnoticed because Web Push carried every message on its own.
674
+ *
675
+ * The API key prefix stays as the fallback for a backend old enough not to
676
+ * return `appId`; the native SDKs do exactly the same.
677
+ */
678
+ private topicAppId;
652
679
  private getOrCreateDeviceId;
653
680
  private generateUUID;
654
681
  private urlBase64ToUint8Array;