@nitra/cap 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/cap",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Nitra capacitor components",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -65,7 +65,7 @@ export async function saveToken() {
65
65
  * @returns {Promise<object>} Web Push token
66
66
  */
67
67
  async function getWebPushToken() {
68
- const serviceWorkerRegistration = await navigator.serviceWorker.register('/sw.js', {
68
+ const serviceWorkerRegistration = await navigator.serviceWorker.register('sw.js', {
69
69
  type: 'module'
70
70
  })
71
71
 
package/save-token/sw.js CHANGED
@@ -1,13 +1,13 @@
1
- import { getMessaging } from 'firebase/messaging/sw'
2
- import { initializeApp } from "firebase/app"
1
+ import { getMessaging } from 'https://www.gstatic.com/firebasejs/10.13.2/firebase-messaging-sw-compat.js'
2
+ import { initializeApp } from 'https://www.gstatic.com/firebasejs/10.13.2/firebase-app-compat.js'
3
3
 
4
4
  const firebaseApp = initializeApp({
5
- apiKey: import.meta.env.VITE_API_KEY,
6
- authDomain: import.meta.env.VITE_AUTH_DOMAIN,
7
- projectId: import.meta.env.VITE_PROJECT_ID,
8
- storageBucket: import.meta.env.VITE_STORAGE_BUCKET,
9
- messagingSenderId: import.meta.env.VITE_MESSAGING_SENDER_ID,
10
- appId: import.meta.env.VITE_APP_ID
5
+ apiKey: import.meta.env.VITE_API_KEY,
6
+ authDomain: import.meta.env.VITE_AUTH_DOMAIN,
7
+ projectId: import.meta.env.VITE_PROJECT_ID,
8
+ storageBucket: import.meta.env.VITE_STORAGE_BUCKET,
9
+ messagingSenderId: import.meta.env.VITE_MESSAGING_SENDER_ID,
10
+ appId: import.meta.env.VITE_APP_ID
11
11
  })
12
12
 
13
13
  export const messaging = getMessaging(firebaseApp)