Add file to LSApplicationQueriesSchemes in your Info.plist WebView React Native

6.1k Views Asked by At

I'm implementing a payment platform in the app that I'm building so the payment form is shown on a WebView Now the form loads okay, but when I change something like I select a payment method from the drop-down web page loads to show options accordingly. But after that refresh it takes me back to the original state as in the page was never changed and throws a warning that reads:

Error opening URL: [Error: Unable to open URL: file:///private/var/containers/Bundle/Application/457E6674-DA77-4676-A2CF-3F21C9572B57/mnopqmobile.app/entry.asp. Add file to LSApplicationQueriesSchemes in your Info.plist.]

While searching for this I've added this in my info.plist file:

    <key>LSApplicationQueriesSchemes</key>
  <array>
      <string>file://</string>
  </array>

And here is the WebView component:

        <WebView
            style={{ flex: 1 }}
            useWebKit={true}
            source={{ html: paymentGatewayHTMLResponse }}
            startInLoadingState={true}
            scrollEnabled={true}
            javaScriptEnabled={true}
            domStorageEnabled={true}
            originWhitelist={["file://"]}
        />

But it still throws that warning and takes me back to the original page.

1

There are 1 best solutions below

0
ochieng seth On

i got this warning too and i changed my code as follows and it worked.

<Key>LSApplicationQueriesSchemes</Key>
  <array>
      <string>URL</string>
  </array>