Skip to content

Commit aa7240e

Browse files
committed
Add closeBrowser in doc
1 parent 7a96353 commit aa7240e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $ npm install --save @swan-io/react-native-browser
2424
## Quickstart
2525

2626
```tsx
27-
import { openBrowser } from "@swan-io/react-native-browser";
27+
import { openBrowser, closeBrowser } from "@swan-io/react-native-browser";
2828
import { useCallback } from "react";
2929
import { Button, SafeAreaView } from "react-native";
3030
import parseUrl from "url-parse";
@@ -34,6 +34,8 @@ const App = () => {
3434
const subscription = Linking.addListener(
3535
"url",
3636
({ url }: { url: string }) => {
37+
closeBrowser(); // required on iOS
38+
3739
const { protocol, host, query } = parseUrl(url, true);
3840
const origin = `${protocol}//${host}`;
3941

0 commit comments

Comments
 (0)