react-native-test-adx 0.1.8 → 0.1.9

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.
@@ -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
- if (presentOfferBrowser(offer.offer_url)) {
151
+ const offerUrl = openableOfferUrl(offer.offer_url);
152
+ if (presentOfferBrowser(offerUrl)) {
149
153
  return;
150
154
  }
151
- await reactNativeUrlOpener.openURL(offer.offer_url);
155
+ await reactNativeUrlOpener.openURL(offerUrl);
152
156
  dismissInterstitial('click');
153
157
  }
154
158
  async trackRecommendationEvent(eventName, parentEventId) {
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
3
  /** Keep in sync with package.json "version" (published npm packages ship lib/ only). */
4
- export const SDK_VERSION = '0.1.8';
4
+ export const SDK_VERSION = '0.1.9';
@@ -1,3 +1,3 @@
1
1
  /** Keep in sync with package.json "version" (published npm packages ship lib/ only). */
2
- export declare const SDK_VERSION = "0.1.8";
2
+ export declare const SDK_VERSION = "0.1.9";
3
3
  //# sourceMappingURL=sdkVersion.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-test-adx",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Adaxon React Native / Expo SDK for event tracking and offer recommendations.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",