android - onNavigationStateChange 在 Android React Native 中不起作用

标签 android react-native custom-scheme-url

你好 friend ,我想在我的 React Native 项目中使用 Android 集成深层链接,所以下面是我的代码

 <WebView
source={{ uri: this.state.authURL }}
ref="webViewAndroidSample"
renderError={(error) => alert(error)}
startInLoadingState = {false}
javaScriptEnabled = {true}
domStorageEnabled = {true}
onNavigationStateChange = {this._onShouldStartLoadWithRequest}/> 

_onShouldStartLoadWithRequest(e){
    console.log("URL "+e.url);

}

当我在我的 web View 中单击其他链接时,我没有在 e.url 中点击链接 url,我记录了我如何解决这个问题的想法?

最佳答案

加载进度: 加载 WebView 时调用的函数。

 onLoadProgress={({ e }) => {
    console.log("URL ", e.nativeEvent.url);
  }}

关于android - onNavigationStateChange 在 Android React Native 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50021287/

相关文章:

java - 媒体播放器无法第二次播放

android - 更新后无法运行我的应用程序

javascript - 如何使用 ActionSheetIOS 附加电子邮件至

ios - 未调用方法 'application:openURL:options:'

ios - CFBundleURLIconFile key 在 iOS 中是否有任何用途?

android - 类不是抽象的/Activity 不能被实例化

java - 如何使用 Firebase 1.0.2 忽略对象模型的新字段

android - react native : Could not find com. android.tools.build :gradle:2. 2.3

react-native - 什么是 React Native 崩溃报告的好设置?