apps-sdk 1.0.97 → 1.0.99

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": "apps-sdk",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -68,15 +68,19 @@ class AdJust {
68
68
  Networking.request(config.ENDPOINTS.ATTRIBUTION_SET_DATA, data);
69
69
  }
70
70
 
71
- trackEventIfExist(eventKeyword, eventValue= 0) {
71
+ async trackEventIfExist(eventKeyword, eventValue= 0) {
72
72
  let finalKeyword = eventKeyword;
73
73
  if (config.EVENTS[finalKeyword]) {
74
74
  if (this.isSpecialEvent(eventKeyword)) {
75
75
  finalKeyword = 'first_' + eventKeyword;
76
76
  if (config.EVENTS[finalKeyword]) {
77
- const alreadySent = storage.getData(finalKeyword);
77
+ const alreadySent = await storage.getData(finalKeyword);
78
+ console.log("Already sent: " + finalKeyword + " " + JSON.stringify(alreadySent));
78
79
  if (!alreadySent) {
80
+ console.log("Storing event: " + finalKeyword);
79
81
  storage.storeData(finalKeyword, true);
82
+ } else {
83
+ finalKeyword = eventKeyword;
80
84
  }
81
85
  }
82
86
  }
@@ -85,7 +89,7 @@ class AdJust {
85
89
  adjustEvent.setRevenue(eventValue, 'EUR');
86
90
  }
87
91
  Adjust.trackEvent(adjustEvent);
88
- console.log("Event sent to AdJust: " + eventKeyword + " with value: " + eventValue)
92
+ console.log("Event sent to AdJust: " + eventKeyword + " with value: " + eventValue + " and keyword: " + finalKeyword + " and event: " + config.EVENTS[finalKeyword]);
89
93
  } else {
90
94
  console.log("Event not found in AdJust, not sent: " + eventKeyword);
91
95
  }
@@ -19,11 +19,12 @@ class NotificationsPush {
19
19
 
20
20
  //FirebaseApp.initializeApp();
21
21
  Notifications.addNotificationReceivedListener(notification => {
22
- console.log('addNotificationReceivedListener',notification);
22
+ console.log('addNotificationReceivedListener',JSON.stringify(notification));
23
23
  });
24
24
 
25
25
  Notifications.addNotificationResponseReceivedListener(response => {
26
- console.log('addNotificationResponseReceivedListener',response);
26
+ console.log('addNotificationResponseReceivedListener',JSON.stringify(response));
27
+ Networking.sendEvent('action', 'click_notification', JSON.stringify({date_notification: response.notification.date, content: response.notification.request.content}));
27
28
  });
28
29
  };
29
30
 
@@ -27,6 +27,7 @@ class Session {
27
27
 
28
28
  initSession = async () => {
29
29
  config.DEBUG_MODE && console.debug("initSession");
30
+ await Networking.sendEvent(config.EVENT_TYPES.OTHER, 'init_session');
30
31
  await this.storeSessionStructure();
31
32
  }
32
33