Back to Cordova

2021 07 02

slack-digest/2021-07-02.md

latest5.0 KB
Original Source

Cordova Slack Digest

Fri, 02 Jul 2021 08:21:20 GMT

User count: 4539

Join the conversation at slack.cordova.io

Channel #general (10 messages)


Thu, 01 Jul 2021 09:59:06 GMT

@suraj99p says

Hello Guys. we use Cordova-iOS : ^6.2.0 in our app. On 28th June 4:00 PM IST, the splash screen used in our app was not auto hiding. Although, we set AutoHideSplashScreen to its default value, which is set as TRUE. It was not hiding after few seconds and was showing for a long time. By 29th June 9:00 PM IST, it automatically got fixed and started working fine. Any idea, what would have caused it. Whenever the splash screen lasted for long, in initial few seconds we got this error [80287:812036] [ProcessSuspension] 0x7fe8ef0174b8 - TimedActivity::activityTimedOut:

Thu, 01 Jul 2021 18:19:22 GMT

@renrick.charles says

Hi all. First time poster here. I have a question about the InAppBrowser plugin. Specifically in regards to how it works on iOS. I'm on Cordova version 8.

The issue is that all links show within the InAppBrowser show a blank screen.

In my index.html I have the following:

<meta
    content="img-src * 'self' data:; default-src * 'self' gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"&gt;```
In my config.xml for the project, I have the following:

```...
    &lt;platform name="ios"&gt;
        &lt;allow-intent href="*" /&gt;
        &lt;access origin="*" /&gt;
        &lt;allow-navigation href="*" /&gt;
...```
I invocate the plugin, roughly, as follows:

``` window.cordova.InAppBrowser.open(src, '_blank', 'location=no,footer=no,enableViewportScale=yes,transitionstyle=crossdissolve')```
But for some reason, while this code works in the iOS simulator, it does not work on real iOS devices.
Why is that?

There's so little documentation out there for this, but a load of queries about it online.
It's definitely the kind of potential issue that should be in official documentation.

Thu, 01 Jul 2021 18:25:22 GMT

@norman137 says

You should be able to see more insights using the safari web inspector. You'll probably will need to cmd+r while the web inspector is focused to refresh the webview to see errors that occur on webview load (safari doesn't capture events that occur before the inspector was attached).

Thu, 01 Jul 2021 18:42:38 GMT

@renrick.charles says

I'll try that, but before I get to that point, would you, or anyone else, have a rough suspicion about why I would see a blank screen here? Why is this such a seemingly common issue online?

Thu, 01 Jul 2021 18:48:49 GMT

@norman137 says

I'm not super well versed in iOS nor the in app browser, but the in app browser is intended to be an isolated webview to load up potentially untrusted website (it won't have access to the cordova.js api), so as long as you're loading a remote site it should work.

Apple I think also enforces certain level of encryption standards so if the website is not using https or is using a known weak TLS configuration, they may block with the default settings.

I don't think any of that explains why it may work in the simulator but not on a real device though...

Thu, 01 Jul 2021 18:53:23 GMT

@renrick.charles says

Appreciate the insight. :)

Thu, 01 Jul 2021 18:59:29 GMT

@norman137 says

a blank screen might seem like a common issue because there's a lot of different problems or different mistakes that yields the same outcome (e.g. document did not load). So the first step into debugging it is finding why the webpage isn't loading. Usually the safari (or chrome if debugging on android) web inspector will tell if there is a JS or networking error with loading up the document, so that probably should be your starting point. If you can't find any information there, then launching from Xcode / Android Studio so that you can monitor the native logs might be the next step, to determine if something is happening on the native side.

Could also try adding the error callback via: https://cordova.apache.org/docs/en/10.x/reference/cordova-plugin-inappbrowser/#inappbrowseraddeventlistener

Thu, 01 Jul 2021 19:16:43 GMT

@jcesarmobile says

Your cordova version doesn’t matter (much), what’s your cordova-ios version?

Thu, 01 Jul 2021 19:29:11 GMT

@renrick.charles says

4.5.5?

Thu, 01 Jul 2021 19:46:36 GMT

@norman137 says

4.5.5 is not apple compliant btw, you'll need to upgrade both the in app browser and cordova-ios to the latest version so that it uses the native WKWebView instead of the UIWebView.

If apple detects traces of UIWebView in your binary, it will be rejected on publish. With that being said, I'm sure on newer iOS versions because of that hard restriction I assume they are not worrying about breaking the UIWebview and I assume they'll completely remove it soon.