react-native-blockable-webview icon indicating copy to clipboard operation
react-native-blockable-webview copied to clipboard

Does not work on iOS

Open Liroo opened this issue 9 years ago • 1 comments

Hey, it seems to not work on iOS.

  _handleAndroidNavigationChange({ nativeEvent }): Boolean {
    const { url } = nativeEvent;
    if (this.props.onLinking && typeof this.props.onLinking === 'function') {
      this.props.onLinking(url);
    }
    Linking.openURL(url);
    return;
  }
...

  render(): ReactElement<*> {
    const {
      html,
      style,
      ...props,
    } = this.props;
     return (
         <BlockableWebView
          {...props}
          style={[style, {height: this.state.height}]}
          injectedJavaScript="document.body.scrollHeight;"
          scrollEnabled={false}
          javaScriptEnabled={true}
          bounces={false}
          source={{ html }}
          onContentSizeChange={this._onHeightChange}
          onNavigationStateChange={this._onNavigationStateChange}

          navigationBlockingPolicies={[{ url: '.*' }]}
          onNavigationBlocked={this._handleAndroidNavigationChange}/>
    );

I try to catch each request to open them with Linking but none request pass by onNavigationBlocked where it works well on Android ! It seems to correctly clock the navigation event (it block the navigation event) but handleAndroidNavigationChange is never called :/

Any clue ?

ps: I saw your PR on React Native repository, great idea, loving it 👍

Liroo avatar Nov 25 '16 14:11 Liroo

yes for me too , it didn't work for ios

fekrifarhani avatar Sep 03 '18 16:09 fekrifarhani