Skip to content

Commit f4e1f15

Browse files
committed
Add closeBrowser in App
1 parent 01f2233 commit f4e1f15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

example/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { openBrowser } from "@swan-io/react-native-browser";
1+
import { closeBrowser, openBrowser } from "@swan-io/react-native-browser";
22
import { useCallback, useEffect } from "react";
33
import { Alert, Button, Linking, SafeAreaView, StyleSheet } from "react-native";
44
import parseUrl from "url-parse";
@@ -16,6 +16,8 @@ export const App = () => {
1616
const subscription = Linking.addListener(
1717
"url",
1818
({ url }: { url: string }) => {
19+
closeBrowser(); // required on iOS
20+
1921
const { protocol, host, query } = parseUrl(url, true);
2022
const origin = `${protocol}//${host}`;
2123

0 commit comments

Comments
 (0)