Closed Pigsnuck closed 4 years ago
Update: I created a fork with my fix. You can use that in your Cordova project if you prefer.
See: https://github.com/Pigsnuck/cordova-plugin-wkwebview-file-xhr
Thanks @Pigsnuck. We will get back to you upon this with the fix
@Pigsnuck Can you provide a sample app demonstrating the issue you faced.
Closing this issue due to lack of response.
After quite a bit of digging, I found out why cordova-plugin-wkwebkit-file-xhr is not correctly loading Mapbox GL JS URLs, even when the following preference is set in config.xml.
The following error is displayed any time I want to get a MapBox URL:
ERROR: {"message":"Bad Request"}
The reason is simple (but hard to find!): URLs are not being correctly escaped! The fix is even simpler.
Replace line 339 in
platforms/iOS/[Project Name]/Plugins/CDVWKWebViewFileXhr.m
from this:To this:
I haven't bothered to create a pull request, as Oracle have stated they will not accept them. You will have to apply this patch manually.