iOS App has white screen

I’ve finally managed to get a clean iOS test version of my app but when the app loads, it just shows [object Object] and nothing appears in the Safari developer console. This app used to work fine in PhoneGap Build and when built with Xcode before December’s deprecation of UIWebView. I have put a console.log in the (document).ready function but this is not executed

So the app runs, but does not put what you expect on the screen, right?

With the Safari Inspector open, have you tried doing a reload so you see all the messages right from startup?

Hi, sorry to be slow to respond - the urgent always seems to take priority over the important! Safari is misbehaving now - it initially recognises the inspectable application and shows the console for a second, but then the console immediately closes and Safari refuses to recognise the application again. Are there any other tools that I can use that are less quirky? I have had this problem with Safari before

The only one I know is this:

It’s still in beta.

Thanks, I’ll give that a try. I might also try rebooting as it works sometimes

Inspect shows another couple of errors, two .map files where it shows “Unexpected end of JSON input”.

. Could this be why Safari drops out? These map files were missing before. I’m going to recompile and rerun the app with these files missing to see what happens. Will report after I’ve done this test

Don’t worry about these messages. Safari is just complaining about a couple of missing debug files - they do not affect execution.

OK, with those map files removed, Safari doesn’t crash, just shows errors that these map files are missing. Now when I force a reload in the Inspector I get these messages:

Does this tell you anything?

The final file it can’t load is the initial screen for the first page of the app

That explains why it does not work. You’ll need to whitelist those files.

This plugin can help: cordova-plugin-whitelist

Great, thanks, I’ll try that and get back to you. Could be a couple of days.

Thanks for your help

Hi. Finally got around to trying this, but it doesn’t seem to have made any difference. For test purposes, I have just allowed all requests. Here’s the relevant section of config.xml:

    <plugin name="cordova-plugin-whitelist">
    <access origin="*" />
    <allow-intent href="*" />
    <allow-navigation href="*" />
1 Like

Tip : If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly.

Maybe try adding

<allow-navigation href="file:*" />

Also, are you setting

<meta http-equiv='Content-Security-Policy'...

in <head> (in index.html)?

(I’m no expert in this - it isn’t really a VoltBuilder issue anymore)

Content-security-policy looks like it needs some research, but I’m not hopeful that it’s the solution. I presume that since this app worked fine with UIWebView, this is some issue with its replacement. If so, not sure where to go now

Contrary to my expectations, adding Content-security-policy finally allowed my app to run. However, it looks completely different from how it is supposed to look. Evidently there are huge differences between how UIWebView and WKWebView work. However, this is definitely not a VoltBuilder problem any more, so the issue can be closed.
I think my next move is to reach out to the VoltBuilder community to get some help on how to revamp my app to work with WKWebView
I’m immensely grateful for your help in getting me this far, much appreciated! I can’t praise your support highly enough
Brian Preece

Thanks for the kind words!

What did your content-security-policy line end up looking like?

Very simple:
<meta http-equiv="Content-Security-Policy" content="default-src 'self'"">
The only web pages it has to load are internal

Hi, my apps still unable to run.
Still stuck at splashscreen even after I follow the steps above.
Can you guide me what to do?

I wonder what is view.html. My apps doesnt have this page.