Skip to content

Commit d01e8f7

Browse files
committed
Move closeBrowser
1 parent aa7240e commit d01e8f7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ const App = () => {
3434
const subscription = Linking.addListener(
3535
"url",
3636
({ url }: { url: string }) => {
37-
closeBrowser(); // required on iOS
38-
3937
const { protocol, host, query } = parseUrl(url, true);
4038
const origin = `${protocol}//${host}`;
4139

4240
if (origin === "com.company.myapp://close") {
41+
closeBrowser(); // required on iOS
4342
console.log(JSON.stringify(query, null, 2));
4443
}
4544
},

example/src/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ export const App = () => {
1616
const subscription = Linking.addListener(
1717
"url",
1818
({ url }: { url: string }) => {
19-
closeBrowser(); // required on iOS
20-
2119
const { protocol, host, query } = parseUrl(url, true);
2220
const origin = `${protocol}//${host}`;
2321

2422
if (origin === "io.swan.rnbrowserexample://close") {
23+
closeBrowser(); // required on iOS
2524
Alert.alert("Deeplink received", JSON.stringify(query, null, 2));
2625
}
2726
},

0 commit comments

Comments
 (0)