Here is the web view I used for my previous project.
<WebView ref="webview" source={{uri:this.state.url}} onNavigationStateChange={this._onNavigationStateChange.bind(this)} javaScriptEnabled = {true} domStorageEnabled = {true} injectedJavaScript = {this.state.cookie} startInLoadingState={false} />
this line is important to you:
onNavigationStateChange={this._onNavigationStateChange.bind(this)}
and you can read the url like this:
_onNavigationStateChange(webViewState){ console.log(webViewState.url) }
If I remember correctly, this works 3 times when loading the URL.
webviewState object prototype:
{ canGoBack: bool, canGoForward: bool, loading: bool, target: number, title: string, url: string, }
3rd (final) time when this event is called, the load attribute is false
let me know if that helps.
dv3
source share