@uptick-ads/react-native-web-sdk 0.3.1 → 0.3.3

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/README.md CHANGED
@@ -51,7 +51,7 @@ Because both presentations work from the same mount point, Uptick can switch a p
51
51
  | `openUrl` | `Linking.openURL` | How accepted offers open; supply your own to use an in-app browser |
52
52
  | `style` | | Style for the inline slot |
53
53
  | `modal` | | Presentation options for the popup. Any option set here is reported to Uptick with the flow, with its value, so performance can be read against it. |
54
- | `webViewProps` | | Extra props passed through to `WebView` |
54
+ | `webViewProps` | | Extra props passed through to `WebView`, except the ones the component sets itself: `source`, `originWhitelist`, `javaScriptEnabled`, `domStorageEnabled`, `setSupportMultipleWindows`, `onMessage`, `onShouldStartLoadWithRequest` and `onOpenWindow` |
55
55
  | `host` | `api.uptick.com` | API host, only for testing against other environments |
56
56
 
57
57
  ### Flow parameters
@@ -71,7 +71,7 @@ The component adds `render_type` (`{ rendered: "inline" | "popup" }`) once the f
71
71
 
72
72
  ## How click-out works
73
73
 
74
- When a user accepts an offer the SDK opens the advertiser link with `window.open`. The component receives that through `onOpenWindow`, hands the URL to `openUrl`, and the page inside the WebView stays put, so the SDK moves on to the next offer while the user is in the browser. Do not set `setSupportMultipleWindows={false}` through `webViewProps`: on Android that makes the WebView start the navigation itself and leaves the offer frozen.
74
+ When a user accepts an offer the SDK opens the advertiser link with `window.open`. The component receives that through `onOpenWindow`, hands the URL to `openUrl`, and the page inside the WebView stays put, so the SDK moves on to the next offer while the user is in the browser.
75
75
 
76
76
  ## Demo
77
77
 
package/index.d.ts CHANGED
@@ -28,6 +28,17 @@ export interface UptickModalOptions {
28
28
  maxCardHeight?: number;
29
29
  }
30
30
 
31
+ /** Props the component sets on the WebView itself, which webViewProps cannot override. */
32
+ export type ReservedWebViewProp =
33
+ | "source"
34
+ | "originWhitelist"
35
+ | "javaScriptEnabled"
36
+ | "domStorageEnabled"
37
+ | "setSupportMultipleWindows"
38
+ | "onMessage"
39
+ | "onShouldStartLoadWithRequest"
40
+ | "onOpenWindow";
41
+
31
42
  export interface UptickFlowProps extends UptickFlowParams {
32
43
  integrationId: string;
33
44
  placement?: string;
@@ -35,7 +46,7 @@ export interface UptickFlowProps extends UptickFlowParams {
35
46
  openUrl?: (url: string) => void | Promise<unknown>;
36
47
  style?: StyleProp<ViewStyle>;
37
48
  modal?: UptickModalOptions;
38
- webViewProps?: Partial<ComponentProps<typeof WebView>>;
49
+ webViewProps?: Omit<Partial<ComponentProps<typeof WebView>>, ReservedWebViewProp>;
39
50
  host?: string;
40
51
  }
41
52
 
@@ -45,5 +56,5 @@ export const version: string;
45
56
  export function customizations(modal?: UptickModalOptions): Record<string, string>;
46
57
  export const FLOW_PARAMS: ReadonlyArray<keyof UptickFlowParams>;
47
58
  export function pickFlowParams(props: Record<string, unknown>): UptickFlowParams;
48
- export function buildEmbedUrl(options: { host: string; integrationId: string; placement?: string; params?: UptickFlowParams; version?: string; customization?: Record<string, string> }): string;
59
+ export function buildEmbedUrl(options: { host: string; integrationId: string; placement?: UptickPlacement; params?: UptickFlowParams; version?: string; customization?: Record<string, string> }): string;
49
60
  export function embedPath(host: string, integrationId: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uptick-ads/react-native-web-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "React Native component that runs the Uptick web SDK inside a WebView, inline or as a popup, with the web integration's parameters",
5
5
  "keywords": [
6
6
  "uptick",
package/src/UptickFlow.js CHANGED
@@ -114,6 +114,13 @@ export function UptickFlow({
114
114
 
115
115
  const webView = (
116
116
  <WebView
117
+ onError={(event) => emit.current && emit.current("webview_error", { description: event.nativeEvent.description })}
118
+ onHttpError={(event) => emit.current && emit.current("webview_http_error", { status: event.nativeEvent.statusCode, url: event.nativeEvent.url })}
119
+ scrollEnabled={false}
120
+ nestedScrollEnabled
121
+ opaque={false}
122
+ {...webViewProps}
123
+ // These follow the spread so webViewProps can't break messaging or click-out.
117
124
  source={source}
118
125
  originWhitelist={["*"]}
119
126
  javaScriptEnabled
@@ -122,12 +129,6 @@ export function UptickFlow({
122
129
  onMessage={onMessage}
123
130
  onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
124
131
  onOpenWindow={onOpenWindow}
125
- onError={(event) => emit.current && emit.current("webview_error", { description: event.nativeEvent.description })}
126
- onHttpError={(event) => emit.current && emit.current("webview_http_error", { status: event.nativeEvent.statusCode, url: event.nativeEvent.url })}
127
- scrollEnabled={false}
128
- nestedScrollEnabled
129
- opaque={false}
130
- {...webViewProps}
131
132
  style={[styles.transparent, { height: isPopup ? Math.min(contentHeight, maxCardHeight) : contentHeight }, webViewProps && webViewProps.style]}
132
133
  />
133
134
  );
package/src/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Kept in step with package.json by the release pipeline; the API records it on every event as integration_version.
2
- export const version = "0.3.1";
2
+ export const version = "0.3.3";