apps-sdk 1.1.2 → 1.1.3

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.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -224,8 +224,8 @@ class PayWall extends React.Component {
224
224
  const stepNumber = data.eventValue.toString().substring(4);
225
225
  MixPanel.trackEvent('Onboarding Screen Viewed', {
226
226
  "onboarding_id": config.PAYWALL_DATA.others.on_boarding.dsn_id.toString(),
227
- "onboarding_total_steps": "4",
228
- "onboarding_step": stepNumber.toString(),
227
+ "onboarding_total_steps": 4,
228
+ "onboarding_step": stepNumber,
229
229
  "onboarding_step_keyword": data.eventName + '_' + data.eventValue,
230
230
  });
231
231
  Networking.sendEvent('action', 'onb_tap_continue_' + data.eventValue, {step: data.eventValue, onboarding_id: config.PAYWALL_DATA.others.on_boarding.dsn_id});
@@ -1,6 +1,7 @@
1
1
  import { Mixpanel } from "mixpanel-react-native";
2
2
  import * as config from '../../config';
3
3
  import Networking from "./Networking";
4
+ import Storage from "./Storage";
4
5
 
5
6
  class MixPanel {
6
7
  constructor() {
@@ -31,7 +32,8 @@ class MixPanel {
31
32
 
32
33
  try {
33
34
  if (!this.devMode) {
34
- if (config.TRACKING_ACTIVE) {
35
+ const trackingPermissionAnswered = await Storage.getData('TRACKING_PERMISSION_ANSWERED');
36
+ if (config.TRACKING_ACTIVE || !trackingPermissionAnswered) {
35
37
  await this.mixpanel.track(eventName, properties);
36
38
  config.DEBUG_MODE && console.log(`MixPanel Event tracked: ${eventName} with properties:`, properties);
37
39
  } else {
@@ -230,7 +230,8 @@ class Networking {
230
230
  }
231
231
 
232
232
  sendEvent = async (eventType, eventKeyword, eventData={}, forceSend = false) => {
233
- if (config.TRACKING_ACTIVE === false && Platform.OS === 'ios' && !forceSend) {
233
+ const trackingPermissionAnswered = await storage.getData('TRACKING_PERMISSION_ANSWERED');
234
+ if (trackingPermissionAnswered && config.TRACKING_ACTIVE === false && Platform.OS === 'ios' && !forceSend) {
234
235
  console.log('Event not sent, tracking is denied (iOS): ', eventType, eventKeyword);
235
236
  console.log('Tracking answered: ', config.TRACKING_ANSWERED);
236
237
  if (!config.TRACKING_ANSWERED) {