react-native-test-adx 0.1.8 → 0.1.10
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/lib/module/AdaxonSdk.js
CHANGED
|
@@ -7,6 +7,9 @@ import { AdaxonSdkError } from "./errors/AdaxonSdkError.js";
|
|
|
7
7
|
import { detectReactNativePlatform, reactNativeAppInfoReader, reactNativeDeviceReader, reactNativeNetworkInfoReader, reactNativeNetworkStatusReader, reactNativeUrlOpener } from "./platform/reactNative.js";
|
|
8
8
|
import { buildAddToCartProperties, buildPurchaseProperties, normalizeEventValues } from "./services/event/normalizeProperties.js";
|
|
9
9
|
import { AdxEvent } from "./services/event/predefined.js";
|
|
10
|
+
function openableOfferUrl(url) {
|
|
11
|
+
return url.replace(/[{}]/g, brace => brace === '{' ? '%7B' : '%7D');
|
|
12
|
+
}
|
|
10
13
|
export class AdaxonSdk {
|
|
11
14
|
static shared = new AdaxonSdk();
|
|
12
15
|
client = null;
|
|
@@ -145,10 +148,11 @@ export class AdaxonSdk {
|
|
|
145
148
|
}
|
|
146
149
|
async openOfferUrl(offer, parentEventId) {
|
|
147
150
|
await this.trackRecommendationEvent(CREATIVE_CLICK_EVENT, parentEventId);
|
|
148
|
-
|
|
151
|
+
const offerUrl = openableOfferUrl(offer.offer_url);
|
|
152
|
+
if (presentOfferBrowser(offerUrl)) {
|
|
149
153
|
return;
|
|
150
154
|
}
|
|
151
|
-
await reactNativeUrlOpener.openURL(
|
|
155
|
+
await reactNativeUrlOpener.openURL(offerUrl);
|
|
152
156
|
dismissInterstitial('click');
|
|
153
157
|
}
|
|
154
158
|
async trackRecommendationEvent(eventName, parentEventId) {
|
package/lib/module/sdkVersion.js
CHANGED
package/package.json
CHANGED