Currently I am able to get the base URL of a page when clicked using the following WebView configuration
const handleUrlChange = (url:string) => {
if (url == videUrl) return;
setVideoUrl(url);
console.log(url);
};
<WebView
startInLoadingState={true}
source={{ uri: 'https://m.youtube.com/'}}
onError={err => console.warn(err)}
originWhitelist={['https://m.youtube.com/']}
onNavigationStateChange={({ url }) => {
urlChangeHandler(url)
}}
/>
The problem is, the entire URL does not show.
When going to https://m.youtube.com/watch?v=aqz-KE-bpKQ only https://m.youtube.com/ returns as url. I need to be able to read watch?v=aqz-KE-bpKQ as well to identify which video a user has navigated to.
How can I retrieve the entire URL?