Skip to content

Commit 6ceb71b

Browse files
GijsWeteringskosmydel
authored andcommitted
Allow Deeplinking via Linking.getInitialURL() (facebook#44552)
Summary: Pull Request resolved: facebook#44552 Changelog: [Android][Fixed] If the RNTester app is started with a deeplink intent, we now correctly navigate there for Android to facilitate e2e testing. This already worked on ios. Reviewed By: javache Differential Revision: D54662737 fbshipit-source-id: 5bbf824c80e226f441bdcbc4fa67e41ab4c3eb33
1 parent a1b5405 commit 6ceb71b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/rn-tester/js/RNTesterAppShared.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ const RNTesterApp = ({
199199
[dispatch],
200200
);
201201
React.useEffect(() => {
202+
// Initial deeplink
203+
Linking.getInitialURL()
204+
.then(url => url != null && handleOpenUrlRequest({url: url}))
205+
.catch(_ => {});
202206
const subscription = Linking.addEventListener('url', handleOpenUrlRequest);
203207
return () => subscription.remove();
204208
}, [handleOpenUrlRequest]);

0 commit comments

Comments
 (0)