Ionic app crashes on iOS 12.2 because of '_alwaysRunsAtForegroundPriority'

后端 未结 6 701
情话喂你
情话喂你 2021-02-06 10:36

On iOS 12.2 my app is terminated just after startup, with this message in xcode:

Terminating app due to uncaught exception \'NSUnknownKeyException\', rea

6条回答
  •  春和景丽
    2021-02-06 10:49

    I think your basic issue is you're running in a WKWebView, which isn't allowed to run in the background reliably. I'm facing a similar issue, and I'm afraid the best short-term solution I could come up with was to use UIWebView. UIWebView isn't a good long-term solution because it's marked as deprecated now. It looks like you're not using Ionic 4 yet, which is really good in this case. I think you can remove the 2 ionic plugins, use cordova@6.5.0 and cordova engine ios 4.5.4. Hopefully, then, when running in Xcode, everything will work and you'll see a message towards the beginning about "Using UIWebView". This issue is part of the evidence I've found that WKWebView isn't expected to work in the background: https://issues.apache.org/jira/browse/CB-10657 https://issues.apache.org/jira/browse/CB-11561

提交回复
热议问题