@quintype/framework 7.33.6-fcm-fix-2.17 → 7.33.6-fcm-fix-2.19

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.
@@ -13,14 +13,13 @@ export function initializeFCM(firebaseConfig) {
13
13
  appId: firebaseConfig.appId,
14
14
  });
15
15
  const messaging = m.getMessaging(app);
16
- return m.getToken(messaging);
17
- // No need to refresh token https://github.com/firebase/firebase-js-sdk/issues/4132
16
+ return m.getToken(messaging, { vapidKey: firebaseConfig.vapidKey });
18
17
  })
19
18
  .then((token) => {
20
19
  return registerFCMTopic(token);
21
20
  })
22
21
  .catch((err) => {
23
- console.error(`Fcm initialization error: ${err}`);
22
+ console.error(err);
24
23
  });
25
24
  }
26
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.33.6-fcm-fix-2.17",
3
+ "version": "7.33.6-fcm-fix-2.19",
4
4
  "description": "Libraries to help build Quintype Node.js apps",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -8,7 +8,7 @@ exports.registerFCMTopic = async function registerFCM (
8
8
  next,
9
9
  { config, client, publisherConfig, fcmServiceCreds }
10
10
  ) {
11
- console.log('fcm server')
11
+
12
12
  const token = get(req, ['body', 'token'], null)
13
13
  if (!token) {
14
14
  res.status(400).send('No Token Found')
@@ -27,22 +27,7 @@ exports.registerFCMTopic = async function registerFCM (
27
27
  return
28
28
  } catch (error) {
29
29
  res.status(500).send(`FCM Subscription Failed: ${error}`)
30
- logger.error({
31
- level: 'error',
32
- logged_data: {
33
- request: {
34
- host: '',
35
- path: '/register-fcm-topic',
36
- time: Date.now(),
37
- method: 'post'
38
- },
39
- response: {
40
- statusCode: 500,
41
- message: error
42
- }
43
- },
44
- message: `PATH => /register-fcm-topic`
45
- })
30
+ logger.error(`Fcm register to topic error: ${error}`)
46
31
  return
47
32
  }
48
33
  }