@ethora/chat-component 26.2.20 → 26.2.21
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/README.md +9 -1
- package/dist/config.d.ts +8 -5
- package/dist/firebase-messaging-sw.js +351 -386
- package/dist/helpers/constants/PLATFORM_CONSTANTS.d.ts +3 -3
- package/dist/hooks/usePushNotifications.d.ts +4 -0
- package/dist/main.js +9132 -9066
- package/dist/main.js.map +1 -1
- package/dist/types/models/config.model.d.ts +2 -0
- package/dist/utils/firebasePushNotifications.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +2 -1
- package/public/firebase-messaging-sw.js +351 -386
package/README.md
CHANGED
|
@@ -121,6 +121,8 @@ export default function App() {
|
|
|
121
121
|
enabled: true,
|
|
122
122
|
softAsk: false,
|
|
123
123
|
vapidPublicKey: 'PLACEHOLDER_VAPID_PUBLIC_KEY',
|
|
124
|
+
iconPath: '/icons/push-icon-192.png',
|
|
125
|
+
badgePath: '/icons/push-badge-72.png',
|
|
124
126
|
firebaseConfig: {
|
|
125
127
|
apiKey: 'PLACEHOLDER_API_KEY',
|
|
126
128
|
authDomain: 'PLACEHOLDER_AUTH_DOMAIN',
|
|
@@ -419,6 +421,8 @@ Below is a grouped reference for all `config` options.
|
|
|
419
421
|
| `pushNotifications.firebaseConfig` | `FBConfig` | Firebase app config for push messaging. |
|
|
420
422
|
| `pushNotifications.serviceWorkerPath` | `string` | Service worker path, default `/firebase-messaging-sw.js`. |
|
|
421
423
|
| `pushNotifications.serviceWorkerScope` | `string` | Service worker scope, default `/`. |
|
|
424
|
+
| `pushNotifications.iconPath` | `string` | Custom icon URL/path for OS push notifications. |
|
|
425
|
+
| `pushNotifications.badgePath` | `string` | Custom badge URL/path for OS push notifications. Falls back to `iconPath`. |
|
|
422
426
|
| `pushNotifications.softAsk` | `boolean` | Do not immediately trigger browser permission prompt. |
|
|
423
427
|
| `pushNotifications.onClick` | `(params) => void \| Promise<void>` | Callback invoked when the user clicks an OS push notification (including cold start via URL marker). |
|
|
424
428
|
|
|
@@ -505,6 +509,8 @@ npx @ethora/chat-component ethora-chat
|
|
|
505
509
|
},
|
|
506
510
|
serviceWorkerPath: '/firebase-messaging-sw.js',
|
|
507
511
|
serviceWorkerScope: '/',
|
|
512
|
+
iconPath: '/icons/push-icon-192.png',
|
|
513
|
+
badgePath: '/icons/push-badge-72.png',
|
|
508
514
|
softAsk: false,
|
|
509
515
|
onClick: async ({ roomJID, messageId, url, data }) => {
|
|
510
516
|
// Your app-level routing/analytics can live here.
|
|
@@ -531,6 +537,8 @@ function PushPermissionButton() {
|
|
|
531
537
|
}
|
|
532
538
|
```
|
|
533
539
|
|
|
540
|
+
`iconPath` and `badgePath` should point to public, reachable assets (for example, files from your app `public/` directory).
|
|
541
|
+
|
|
534
542
|
## Auth Strategies
|
|
535
543
|
|
|
536
544
|
| Strategy | Config shape | Best for |
|
|
@@ -695,4 +703,4 @@ This is a practical planning snapshot for cross-platform consumers. It is not a
|
|
|
695
703
|
|
|
696
704
|
## License
|
|
697
705
|
|
|
698
|
-
AGPL. See [LICENSE.txt](./LICENSE.txt).
|
|
706
|
+
AGPL. See [LICENSE.txt](./LICENSE.txt).
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export declare const VITE_APP_API_URL
|
|
1
|
+
export declare const VITE_APP_API_URL: string;
|
|
2
2
|
export declare const VITE_APP_DISABLE_STRICT = "true";
|
|
3
|
-
export declare const VITE_APP_DOMAIN_NAME
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
3
|
+
export declare const VITE_APP_DOMAIN_NAME: string;
|
|
4
|
+
export declare const VITE_APP_WEB_DOMAIN: string;
|
|
5
|
+
export declare const VITE_APP_WEB_URL: string;
|
|
6
|
+
export declare const VITE_APP_XMPP_BASEDOMAIN_OLD: string;
|
|
7
|
+
export declare const VITE_APP_XMPP_BASEDOMAIN: string;
|
|
8
|
+
export declare const VITE_APP_XMPP_CONFERENCE: string;
|
|
9
|
+
export declare const SERVICE: string;
|