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

iOS: NSPOSIXErrorDomain Error Code 1 when using local source

Open jayporta opened this issue 6 years ago • 0 comments

Hi. I started using this plugin just to hide the form bar above the keyboard in my app’s webview, but now I get an NSPOSIXErrorDomain error every time I install the app on a device, but the weird part is it only happens when the app is installed from Test Flight. The error does not appear when building it and running it on a device via Xcode.

This has never happened when using React Native’s built-in WebView.

I am using the allowFileAccessFromFileURLs prop.

      <WebView
            style={styles.webView}
            ref={(ref) => { this.webView = ref; }}
            scrollEnabled={false}
            javaScriptEnabled
            javaScriptEnabledAndroid
            hideAccessory
            allowFileAccessFromFileURLs
            source={require('./index.html')}
            onLoad={this.sendDataToWebview}
            onMessage={event => this.handleOnMessage(event.nativeEvent.data)}
            onNavigationStateChange={(event) => {
              // https://stackoverflow.com/a/40382325
              if (event.navigationType && event.navigationType === 'click') {
                this.webView.stopLoading();
                Linking.openURL(event.url);
              }
            }}
       />

jayporta avatar Oct 18 '18 11:10 jayporta