apps-sdk 1.0.59 → 1.0.60
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 +1 -1
- package/src/libraries/AdJust.js +26 -57
- package/src/libraries/Session.js +6 -6
package/package.json
CHANGED
package/src/libraries/AdJust.js
CHANGED
|
@@ -22,6 +22,7 @@ class AdJust {
|
|
|
22
22
|
}, 60000);
|
|
23
23
|
});
|
|
24
24
|
Adjust.create(adjustConfig)
|
|
25
|
+
this.updateAttributionInfo();
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
updateAttributionInfo() {
|
|
@@ -110,78 +111,46 @@ class AdJust {
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
async getAttribution() {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
} else {
|
|
119
|
-
reject('Invalid Attribution');
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
Session.setAdjustAttribution(attribution);
|
|
125
|
-
} catch (error) {
|
|
126
|
-
console.error(error);
|
|
127
|
-
}
|
|
114
|
+
Adjust.getAttribution((attribution) => {
|
|
115
|
+
if (attribution) {
|
|
116
|
+
Session.setAdjustAttribution(attribution);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
128
119
|
}
|
|
129
120
|
|
|
130
121
|
async getAdid() {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
reject('Invalid Adid');
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
122
|
+
Adjust.getAdid((adid) => {
|
|
123
|
+
if (adid) {
|
|
124
|
+
Session.setAdjustAttributionID(adid);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
141
128
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
129
|
+
async getIdfa() {
|
|
130
|
+
await Adjust.getIdfa((idfa) => {
|
|
131
|
+
if (typeof idfa === 'string' && idfa.length > 0 && idfa !== '00000000-0000-0000-0000-000000000000') {
|
|
132
|
+
Session.setAdjustIDFA(idfa);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
146
135
|
}
|
|
147
136
|
|
|
148
137
|
async getGoogleAdId() {
|
|
149
138
|
try {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
} else {
|
|
155
|
-
reject('Invalid Google AdId');
|
|
156
|
-
}
|
|
157
|
-
});
|
|
139
|
+
Adjust.getGoogleAdId((googleAdId) => {
|
|
140
|
+
if (typeof googleAdId === 'string' && googleAdId.length > 0) {
|
|
141
|
+
Session.setAdjustGoogleAdid(googleAdId);
|
|
142
|
+
}
|
|
158
143
|
});
|
|
159
|
-
|
|
160
|
-
Session.setAdjustGoogleAdid(googleAdId);
|
|
161
144
|
} catch (error) {
|
|
162
|
-
console.
|
|
145
|
+
console.log(error);
|
|
163
146
|
}
|
|
164
147
|
}
|
|
165
148
|
|
|
166
|
-
async getIdfa() {
|
|
167
|
-
try {
|
|
168
|
-
const idfa = await new Promise((resolve, reject) => {
|
|
169
|
-
Adjust.getIdfa((idfa) => {
|
|
170
|
-
if (idfa && idfa !== '00000000-0000-0000-0000-000000000000') {
|
|
171
|
-
resolve(idfa);
|
|
172
|
-
} else {
|
|
173
|
-
reject('Invalid IDFA');
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
Session.setAdjustIDFA(idfa);
|
|
178
|
-
} catch (error) {
|
|
179
|
-
console.error(error);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
149
|
getSDKVersion() {
|
|
183
150
|
Adjust.getSdkVersion((sdkVersion) => {
|
|
184
|
-
|
|
151
|
+
if (typeof sdkVersion === 'string' && sdkVersion.length > 0) {
|
|
152
|
+
this.sdkVersion = sdkVersion;
|
|
153
|
+
}
|
|
185
154
|
});
|
|
186
155
|
}
|
|
187
156
|
}
|
package/src/libraries/Session.js
CHANGED
|
@@ -46,9 +46,9 @@ class Session {
|
|
|
46
46
|
"domains": "0"
|
|
47
47
|
},
|
|
48
48
|
adjust : {
|
|
49
|
-
attribution_id:
|
|
50
|
-
idfa:
|
|
51
|
-
googleAdid:
|
|
49
|
+
attribution_id: '',
|
|
50
|
+
idfa: '',
|
|
51
|
+
googleAdid: '',
|
|
52
52
|
},
|
|
53
53
|
dev : false,
|
|
54
54
|
lang : Localization.getLocales()[0].languageCode || 'en',
|
|
@@ -149,7 +149,7 @@ class Session {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
getAdjustIDFA = () => {
|
|
152
|
-
return this.sessionData.adjust.idfa ||
|
|
152
|
+
return this.sessionData.adjust.idfa || '';
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
setAdjustGoogleAdid = (googleAdid) => {
|
|
@@ -158,7 +158,7 @@ class Session {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
getAdjustGoogleAdid = () => {
|
|
161
|
-
return this.sessionData.adjust.googleAdid
|
|
161
|
+
return this.sessionData.adjust.googleAdid;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
setAdjustAttributionID = (attribution_id) => {
|
|
@@ -167,7 +167,7 @@ class Session {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
getAdjustAttributionID = () => {
|
|
170
|
-
return this.sessionData.adjust.attribution_id
|
|
170
|
+
return this.sessionData.adjust.attribution_id;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
setAdjustAttribution = (attribution) => {
|