Skip to content

Commit 33aad24

Browse files
now opening external links within the app
1 parent d372a86 commit 33aad24

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323

2424
- Now opening oauth tabs inside the app instead of in a separate browser. This simplifies the configuration process and makes it easier for the user to get back to the app in case of failures.
2525
- When onOAuthRequested is provided to the connect widget it no longer overrides oauth redirect behavior. It is now called in addition to the built in redirect behavior.
26+
- Now opening external links without leaving the app
2627

2728
## [3.0.0]
2829

src/components/renderer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useRef, MutableRefObject, ReactElement } from "react"
22
import { StyleProp, ViewStyle, View } from "react-native"
33
import { WebView } from "react-native-webview"
44
import { Payload } from "@mxenabled/widget-post-message-definitions"
5-
5+
import * as WebBrowser from "expo-web-browser"
66
import { Props, useSsoUrl } from "../sso"
77
import { makeRequestInterceptor } from "./request_interceptor"
88
import { useFullscreenStyles } from "./screen_dimensions"
@@ -62,6 +62,9 @@ export function useWidgetRendererWithRef<Configuration>(
6262
javaScriptEnabled={true}
6363
domStorageEnabled={true}
6464
incognito={true}
65+
onOpenWindow={(event) => {
66+
WebBrowser.openBrowserAsync(event.nativeEvent.targetUrl)
67+
}}
6568
onShouldStartLoadWithRequest={handler}
6669
onError={props.onWebViewError}
6770
/>

0 commit comments

Comments
 (0)