Local file in webview dosn't work in standalone app


#1

Works through the expo app locally but not as a standalone app nor when published on expo.io. What could I be doing wrong?

const OfflineKartHTML = require('./../assets/src/OfflineMap.html')


        <WebView
          originWhitelist={['*']}
          javaScriptEnabled={true}
          domStorageEnabled={true}
          mixedContentMode={'always'}
          geolocationEnabled={true}
          startInLoadingState={true}
          source={OfflineKartHTML}
          style={{ flex: 1 }}
          ref={(el) => { this.webview = el; }}
          onMessage={this.handleMessage}
          zIndex={-2}
          renderError={() => alert('error')}
        >
        </WebView>

#2

Hey @vidarso,

Can you share what is happening when you say it doesn’t work? Also, is this occurring on both platforms?

Cheers,

Adam


#3

Only tried Android, I don’t have an iOS device. The render error appears, without it nothing appears.


closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.