notifly-sdk 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/index.js +8 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -43,7 +43,13 @@ exports.sessionStart = async function () {
43
43
 
44
44
  exports.initialize = async function (prjId, userName, password) {
45
45
  try {
46
+ messaging().requestPermission();
47
+
46
48
  messaging().onNotificationOpenedApp(async (remoteMessage) => {
49
+ const link = remoteMessage.data?.link
50
+ if (link) {
51
+ Linking.openURL(link);
52
+ }
47
53
  await logEvent("push_click", { "campaign_id": remoteMessage.data.campaign_id, "status": "background" }, null, true);
48
54
  });
49
55
 
@@ -53,9 +59,9 @@ exports.initialize = async function (prjId, userName, password) {
53
59
  .getInitialNotification()
54
60
  .then(async (remoteMessage) => {
55
61
  if (remoteMessage) {
56
- const link = remoteMessage.notification?.android?.link;
62
+ const link = remoteMessage.data?.link
57
63
  if (link) {
58
- Linking.openURL(remoteMessage.notification?.android?.link);
64
+ Linking.openURL(link);
59
65
  }
60
66
  await logEvent("push_click", { "campaign_id": remoteMessage.data.campaign_id, "status": "quit" }, null, true);
61
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notifly-sdk",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {