@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.cjs
CHANGED
|
@@ -815,6 +815,7 @@ var require_build = __commonJS({
|
|
|
815
815
|
"use strict";
|
|
816
816
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
817
817
|
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;
|
|
818
|
+
exports.normalizeMetaInstallReferrers = normalizeMetaInstallReferrers;
|
|
818
819
|
exports.normalizeAdvertisingId = normalizeAdvertisingId;
|
|
819
820
|
exports.fromMaxAd = fromMaxAd;
|
|
820
821
|
exports.detectDebug = detectDebug;
|
|
@@ -824,7 +825,7 @@ var require_build = __commonJS({
|
|
|
824
825
|
var adservices_1 = require_adservices();
|
|
825
826
|
var deeplink_1 = require_deeplink();
|
|
826
827
|
var adRevenue_1 = require_adRevenue();
|
|
827
|
-
exports.SDK_VERSION = "0.
|
|
828
|
+
exports.SDK_VERSION = "0.10.0";
|
|
828
829
|
var skan_2 = require_skan();
|
|
829
830
|
Object.defineProperty(exports, "Skan", { enumerable: true, get: function() {
|
|
830
831
|
return skan_2.Skan;
|
|
@@ -915,6 +916,32 @@ var require_build = __commonJS({
|
|
|
915
916
|
var FLUSH_DELAY_MS = 3e3;
|
|
916
917
|
var MAX_INSTALL_ATTEMPTS = 3;
|
|
917
918
|
var SESSION_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
919
|
+
var META_PROVIDERS = ["facebook", "instagram", "facebook_lite"];
|
|
920
|
+
function normalizeMetaInstallReferrers(raw) {
|
|
921
|
+
if (!Array.isArray(raw))
|
|
922
|
+
return [];
|
|
923
|
+
const out = [];
|
|
924
|
+
for (const item of raw) {
|
|
925
|
+
if (!item || typeof item !== "object")
|
|
926
|
+
continue;
|
|
927
|
+
const r = item;
|
|
928
|
+
if (typeof r.provider !== "string" || !META_PROVIDERS.includes(r.provider))
|
|
929
|
+
continue;
|
|
930
|
+
if (typeof r.installReferrer !== "string" || !r.installReferrer.trim())
|
|
931
|
+
continue;
|
|
932
|
+
const isCt = r.isCt === 1 || r.isCt === true ? 1 : r.isCt === 0 || r.isCt === false ? 0 : null;
|
|
933
|
+
if (isCt === null)
|
|
934
|
+
continue;
|
|
935
|
+
const ts = typeof r.actualTimestamp === "number" && Number.isFinite(r.actualTimestamp) && r.actualTimestamp > 0 ? r.actualTimestamp : void 0;
|
|
936
|
+
out.push({
|
|
937
|
+
provider: r.provider,
|
|
938
|
+
installReferrer: r.installReferrer,
|
|
939
|
+
isCt,
|
|
940
|
+
...ts !== void 0 ? { actualTimestamp: ts } : {}
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
return out;
|
|
944
|
+
}
|
|
918
945
|
var TRACKING_AUTHORIZATIONS = ["not_determined", "restricted", "denied", "authorized"];
|
|
919
946
|
var MAX_PRECISION = {
|
|
920
947
|
exact: "precise",
|
|
@@ -2109,6 +2136,24 @@ var require_build = __commonJS({
|
|
|
2109
2136
|
}
|
|
2110
2137
|
return result;
|
|
2111
2138
|
}
|
|
2139
|
+
/**
|
|
2140
|
+
* Meta's Install Referrer answers, Android only, read just before the install
|
|
2141
|
+
* leaves. Never throws: an old native build, a bridge teardown or no Meta app
|
|
2142
|
+
* installed all mean « no field ».
|
|
2143
|
+
*/
|
|
2144
|
+
async readMetaInstallReferrers(platform) {
|
|
2145
|
+
var _a, _b;
|
|
2146
|
+
const read = (_a = this.opts.native) == null ? void 0 : _a.getMetaInstallReferrers;
|
|
2147
|
+
if (platform !== "android" || !read)
|
|
2148
|
+
return void 0;
|
|
2149
|
+
try {
|
|
2150
|
+
const appId = ((_b = this.opts.metaAppId) == null ? void 0 : _b.trim()) || void 0;
|
|
2151
|
+
const list = normalizeMetaInstallReferrers(await read.call(this.opts.native, appId));
|
|
2152
|
+
return list.length ? list : void 0;
|
|
2153
|
+
} catch {
|
|
2154
|
+
return void 0;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2112
2157
|
/** Only with the host's opt-in; a zeroed or malformed id is never sent. */
|
|
2113
2158
|
async readAdvertisingId() {
|
|
2114
2159
|
var _a;
|
|
@@ -2141,10 +2186,12 @@ var require_build = __commonJS({
|
|
|
2141
2186
|
}
|
|
2142
2187
|
}
|
|
2143
2188
|
const advertisingId = await this.readAdvertisingId();
|
|
2189
|
+
const metaInstallReferrers = await this.readMetaInstallReferrers(platform);
|
|
2144
2190
|
const ok = await this.post({
|
|
2145
2191
|
install: {
|
|
2146
2192
|
platform,
|
|
2147
2193
|
installReferrer: referrer.referrer,
|
|
2194
|
+
...metaInstallReferrers ? { metaInstallReferrers } : {},
|
|
2148
2195
|
appUserId: this.opts.userId,
|
|
2149
2196
|
advertisingId,
|
|
2150
2197
|
context: this.context
|