apps-sdk 1.0.143 → 1.0.144
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
package/src/libraries/AdJust.js
CHANGED
|
@@ -8,12 +8,12 @@ import Networking from './Networking';
|
|
|
8
8
|
class AdJust {
|
|
9
9
|
sdkVersion = null;
|
|
10
10
|
attribution = {};
|
|
11
|
-
async initialize() {
|
|
11
|
+
async initialize(adjustToken = null) {
|
|
12
12
|
const adjustEnvironment = config.ADJUST.ENVIRONMENT === 'SANDBOX' ? AdjustConfig.EnvironmentSandbox : AdjustConfig.EnvironmentProduction;
|
|
13
13
|
const adjustLogLevel = config.ADJUST.LOG_LEVEL === 'VERBOSE' ? AdjustConfig.LogLevelVerbose : AdjustConfig.LogLevelSuppress;
|
|
14
14
|
console.log("Initializing AdJust. Environment: " + adjustEnvironment + ", Log level: " + adjustLogLevel + ", config.TRACKING_ACTIVE: " + config.TRACKING_ACTIVE);
|
|
15
15
|
try {
|
|
16
|
-
const adjustConfig = new AdjustConfig(config.ADJUST.ADJUST_TOKEN, adjustEnvironment);
|
|
16
|
+
const adjustConfig = new AdjustConfig(adjustToken || config.ADJUST.ADJUST_TOKEN, adjustEnvironment);
|
|
17
17
|
adjustConfig.setLogLevel(adjustLogLevel);
|
|
18
18
|
const self = this;
|
|
19
19
|
adjustConfig.setAttributionCallback(function (attribution) {
|
package/src/libraries/Session.js
CHANGED
|
@@ -39,7 +39,7 @@ class Session {
|
|
|
39
39
|
storeSessionStructure = async () => {
|
|
40
40
|
this.sessionData = {
|
|
41
41
|
user_id: null,
|
|
42
|
-
isFirstOpen:
|
|
42
|
+
isFirstOpen: !(await Storage.getData("FirstOpenAlreadyExecuted")),
|
|
43
43
|
app: {
|
|
44
44
|
shortVersion: Constants.expoConfig.version,
|
|
45
45
|
package: Constants.expoConfig.android.package || Constants.expoConfig.ios.bundleIdentifier,
|
package/src/libraries/Storage.js
CHANGED
|
@@ -355,6 +355,8 @@ class Storage {
|
|
|
355
355
|
|
|
356
356
|
async compressImage(imageUri, maxSizeMB = 5) {
|
|
357
357
|
try {
|
|
358
|
+
const sourceFileSize = await this.getFileSize(imageUri);
|
|
359
|
+
config.DEBUG_MODE && console.debug('source image file size (MB):', sourceFileSize);
|
|
358
360
|
const qualities = [0.8, 0.6, 0.4, 0.2];
|
|
359
361
|
for (const quality of qualities) {
|
|
360
362
|
const context = ImageManipulator.manipulate(imageUri);
|
|
@@ -362,6 +364,7 @@ class Storage {
|
|
|
362
364
|
const compressed = await image.saveAsync({ compress: quality, format: SaveFormat.JPEG });
|
|
363
365
|
const fileSize = await this.getFileSize(compressed.uri);
|
|
364
366
|
if (fileSize < maxSizeMB) {
|
|
367
|
+
config.DEBUG_MODE && console.debug('compressed image file size (MB):', fileSize);
|
|
365
368
|
return compressed.uri;
|
|
366
369
|
}
|
|
367
370
|
}
|
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(): Promise<void>;
|
|
170
|
+
initialize(initialize: string): Promise<void>;
|
|
171
171
|
updateAttributionInfo(): void;
|
|
172
172
|
getAttributionData(): Promise<any>;
|
|
173
173
|
sendAttributionData(attribution: any): Promise<void>;
|