@traqio/web 0.6.0 → 0.6.1
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/build/index.cjs +48 -1
- package/build/index.cjs.map +2 -2
- package/build/index.js +48 -1
- package/build/index.js.map +2 -2
- package/build/traqio.min.js +1 -1
- package/build/traqio.min.js.map +3 -3
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -810,6 +810,7 @@ var require_build = __commonJS({
|
|
|
810
810
|
"use strict";
|
|
811
811
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
812
812
|
exports.Traqio = exports.Client = exports.AdRevenueGate = exports.watchReactNativeAds = exports.fromMaxAdInfo = exports.fromGoogleMobileAdsPaid = exports.fromGoogleMobileAdsNativeAd = exports.fromGoogleMobileAdsChannel = exports.fromCapacitorAdMob = exports.MAX_RN_REVENUE_EVENTS = exports.MAX_RN_MIN_VERSION = exports.GMA_MIN_VERSION = exports.GMA_FULLSCREEN_CHANNELS = exports.CAPACITOR_ADMOB_PAID_EVENTS = exports.isTrackingUrl = exports.isOpenUrl = exports.ANALYTICS_SESSION_IDLE_MS = exports.reportAdServicesToken = exports.Skan = exports.SDK_VERSION = void 0;
|
|
813
|
+
exports.normalizeMetaInstallReferrers = normalizeMetaInstallReferrers;
|
|
813
814
|
exports.normalizeAdvertisingId = normalizeAdvertisingId;
|
|
814
815
|
exports.fromMaxAd = fromMaxAd;
|
|
815
816
|
exports.detectDebug = detectDebug;
|
|
@@ -819,7 +820,7 @@ var require_build = __commonJS({
|
|
|
819
820
|
var adservices_1 = require_adservices();
|
|
820
821
|
var deeplink_1 = require_deeplink();
|
|
821
822
|
var adRevenue_1 = require_adRevenue();
|
|
822
|
-
exports.SDK_VERSION = "0.
|
|
823
|
+
exports.SDK_VERSION = "0.10.0";
|
|
823
824
|
var skan_2 = require_skan();
|
|
824
825
|
Object.defineProperty(exports, "Skan", { enumerable: true, get: function() {
|
|
825
826
|
return skan_2.Skan;
|
|
@@ -910,6 +911,32 @@ var require_build = __commonJS({
|
|
|
910
911
|
var FLUSH_DELAY_MS = 3e3;
|
|
911
912
|
var MAX_INSTALL_ATTEMPTS = 3;
|
|
912
913
|
var SESSION_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
914
|
+
var META_PROVIDERS = ["facebook", "instagram", "facebook_lite"];
|
|
915
|
+
function normalizeMetaInstallReferrers(raw) {
|
|
916
|
+
if (!Array.isArray(raw))
|
|
917
|
+
return [];
|
|
918
|
+
const out = [];
|
|
919
|
+
for (const item of raw) {
|
|
920
|
+
if (!item || typeof item !== "object")
|
|
921
|
+
continue;
|
|
922
|
+
const r = item;
|
|
923
|
+
if (typeof r.provider !== "string" || !META_PROVIDERS.includes(r.provider))
|
|
924
|
+
continue;
|
|
925
|
+
if (typeof r.installReferrer !== "string" || !r.installReferrer.trim())
|
|
926
|
+
continue;
|
|
927
|
+
const isCt = r.isCt === 1 || r.isCt === true ? 1 : r.isCt === 0 || r.isCt === false ? 0 : null;
|
|
928
|
+
if (isCt === null)
|
|
929
|
+
continue;
|
|
930
|
+
const ts = typeof r.actualTimestamp === "number" && Number.isFinite(r.actualTimestamp) && r.actualTimestamp > 0 ? r.actualTimestamp : void 0;
|
|
931
|
+
out.push({
|
|
932
|
+
provider: r.provider,
|
|
933
|
+
installReferrer: r.installReferrer,
|
|
934
|
+
isCt,
|
|
935
|
+
...ts !== void 0 ? { actualTimestamp: ts } : {}
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
return out;
|
|
939
|
+
}
|
|
913
940
|
var TRACKING_AUTHORIZATIONS = ["not_determined", "restricted", "denied", "authorized"];
|
|
914
941
|
var MAX_PRECISION = {
|
|
915
942
|
exact: "precise",
|
|
@@ -2104,6 +2131,24 @@ var require_build = __commonJS({
|
|
|
2104
2131
|
}
|
|
2105
2132
|
return result;
|
|
2106
2133
|
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Meta's Install Referrer answers, Android only, read just before the install
|
|
2136
|
+
* leaves. Never throws: an old native build, a bridge teardown or no Meta app
|
|
2137
|
+
* installed all mean « no field ».
|
|
2138
|
+
*/
|
|
2139
|
+
async readMetaInstallReferrers(platform) {
|
|
2140
|
+
var _a, _b;
|
|
2141
|
+
const read = (_a = this.opts.native) == null ? void 0 : _a.getMetaInstallReferrers;
|
|
2142
|
+
if (platform !== "android" || !read)
|
|
2143
|
+
return void 0;
|
|
2144
|
+
try {
|
|
2145
|
+
const appId = ((_b = this.opts.metaAppId) == null ? void 0 : _b.trim()) || void 0;
|
|
2146
|
+
const list = normalizeMetaInstallReferrers(await read.call(this.opts.native, appId));
|
|
2147
|
+
return list.length ? list : void 0;
|
|
2148
|
+
} catch {
|
|
2149
|
+
return void 0;
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2107
2152
|
/** Only with the host's opt-in; a zeroed or malformed id is never sent. */
|
|
2108
2153
|
async readAdvertisingId() {
|
|
2109
2154
|
var _a;
|
|
@@ -2136,10 +2181,12 @@ var require_build = __commonJS({
|
|
|
2136
2181
|
}
|
|
2137
2182
|
}
|
|
2138
2183
|
const advertisingId = await this.readAdvertisingId();
|
|
2184
|
+
const metaInstallReferrers = await this.readMetaInstallReferrers(platform);
|
|
2139
2185
|
const ok = await this.post({
|
|
2140
2186
|
install: {
|
|
2141
2187
|
platform,
|
|
2142
2188
|
installReferrer: referrer.referrer,
|
|
2189
|
+
...metaInstallReferrers ? { metaInstallReferrers } : {},
|
|
2143
2190
|
appUserId: this.opts.userId,
|
|
2144
2191
|
advertisingId,
|
|
2145
2192
|
context: this.context
|