apps-sdk 1.1.23 → 1.1.25

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.23",
3
+ "version": "1.1.25",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,12 +4,12 @@ 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
+ import {Adapty, MixPanel} from "./index";
8
8
 
9
9
  class AdJust {
10
10
  sdkVersion = null;
11
11
  attribution = {};
12
- async initialize(adjustToken = null) {
12
+ async initialize(adjustToken = null, sendAttributionToAdapty = false) {
13
13
  const adjustEnvironment = config.ADJUST.ENVIRONMENT === 'SANDBOX' ? AdjustConfig.EnvironmentSandbox : AdjustConfig.EnvironmentProduction;
14
14
  const adjustLogLevel = config.ADJUST.LOG_LEVEL === 'VERBOSE' ? AdjustConfig.LogLevelVerbose : AdjustConfig.LogLevelSuppress;
15
15
  console.log("Initializing AdJust. Environment: " + adjustEnvironment + ", Log level: " + adjustLogLevel + ", config.TRACKING_ACTIVE: " + config.TRACKING_ACTIVE);
@@ -21,6 +21,9 @@ class AdJust {
21
21
  adjustConfig.setAttributionCallback(function (attribution) {
22
22
  self.attribution = attribution;
23
23
  Networking.sendEvent('other', 'adjust_attribution_received', attribution, true);
24
+ if (sendAttributionToAdapty && Adapty.isActivated()) {
25
+ Adapty.updateAdjustAttributionData(attribution);
26
+ }
24
27
  setTimeout(() => {
25
28
  self.sendAttributionData(attribution);
26
29
  }, 30000);
@@ -134,6 +134,22 @@ class Adapty {
134
134
  return null;
135
135
  }
136
136
  }
137
+
138
+ async updateAdjustAttributionData(adjustData) {
139
+ try {
140
+ await adapty.updateAttribution(adjustData, 'adjust');
141
+ } catch (error) {
142
+ console.error('Error updating attribution data:', error);
143
+ }
144
+ }
145
+
146
+ async setAdjustIntegrationIdentifier(integrationIdentifier) {
147
+ try {
148
+ await adapty.setIntegrationIdentifier('adjust_device_id', integrationIdentifier);
149
+ } catch (error) {
150
+ console.error('Error setting integration identifier:', error);
151
+ }
152
+ }
137
153
  }
138
154
 
139
155
  export default new Adapty();
package/types/index.d.ts CHANGED
@@ -167,7 +167,7 @@ declare module 'apps-sdk' {
167
167
  export class AdJust {
168
168
  sdkVersion: string | null;
169
169
  attribution: object;
170
- initialize(adjustToken?: string): Promise<void>;
170
+ initialize(adjustToken?: string, sendAttributionToAdapty?: boolean): Promise<void>;
171
171
  updateAttributionInfo(): void;
172
172
  getAttributionData(): Promise<any>;
173
173
  sendAttributionData(attribution: any): Promise<void>;
@@ -219,6 +219,8 @@ declare module 'apps-sdk' {
219
219
  preloadPaywall(placementID: any, lang: any): Promise<any>
220
220
  showPaywallPreloaded(paywallView: any, eventHandlers?: PaywallEventHandlers): Promise<void>;
221
221
  getProfile(): Promise<any>;
222
+ updateAdjustAttributionData(attribution: any): Promise<void>;
223
+ setAdjustIntegrationIdentifier(adjustIntegrationIdentifier: string): Promise<void>;
222
224
  }
223
225
 
224
226
  export class TrackingTransparency {