apps-sdk 1.0.164 → 1.0.166

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.164",
3
+ "version": "1.0.166",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,6 +4,7 @@ import { default as storage } from './Storage';
4
4
  import Session from './Session';
5
5
  import {Platform} from "react-native";
6
6
  import Networking from './Networking';
7
+ import {MixPanel} from "./index";
7
8
 
8
9
  class AdJust {
9
10
  sdkVersion = null;
@@ -110,6 +111,11 @@ class AdJust {
110
111
  Adjust.getAttribution((attribution) => {
111
112
  if (attribution) {
112
113
  Session.setAdjustAttribution(attribution);
114
+ if (MixPanel.isMixpanelInitialized()) {
115
+ for (let key in attribution) {
116
+ MixPanel.mixpanel.getPeople().set(key, attribution[key]);
117
+ }
118
+ }
113
119
  }
114
120
  });
115
121
  }
@@ -39,7 +39,12 @@ class MixPanel {
39
39
  this.mixpanel.getPeople().set('subscribed_user', Session.getIsSubscribed());
40
40
  this.mixpanel.getPeople().set('app_version', Constants.expoConfig.version);
41
41
  this.mixpanel.getPeople().set('language', Localization.getLocales()[0].languageCode || 'en');
42
- config.DEBUG_MODE && console.log(`MixPanel User identified: ${userId}`);
42
+ config.DEBUG_MODE && console.log(`MixPanel User identified: ${userId} with data:`, {
43
+ campaign_source: Session.sessionData.adjust.attribution.source || '',
44
+ subscribed_user: Session.getIsSubscribed(),
45
+ app_version: Constants.expoConfig.version,
46
+ language: Localization.getLocales()[0].languageCode || 'en'
47
+ });
43
48
  } catch (error) {
44
49
  console.error('Error identifying user:', error);
45
50
  }
@@ -58,6 +63,10 @@ class MixPanel {
58
63
  console.error('Error tracking event:', error);
59
64
  }
60
65
  }
66
+
67
+ isMixpanelInitialized() {
68
+ return this.mixpanel !== null;
69
+ }
61
70
  }
62
71
 
63
72
  export default new MixPanel();
package/types/index.d.ts CHANGED
@@ -184,6 +184,7 @@ declare module 'apps-sdk' {
184
184
  initialize(token?: string, trackAutomaticEvents?: boolean, useNative?: boolean): Promise<void>;
185
185
  identifyUser(userID: string): Promise<void>;
186
186
  trackEvent(event: string, properties?: object): Promise<void>;
187
+ isMixpanelInitialized(): boolean;
187
188
  }
188
189
 
189
190
  export class TrackingTransparency {