apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

The <content /> config setting for the entrypoint of the app is not working #1217

Closed CodeWithOz closed 1 year ago

CodeWithOz commented 2 years ago

Bug Report

Specifying a custom entry point for the app using <content src="someothername.html" /> is not working.

Problem

My app's entry point is named main.html rather than index.html. On Android it works as expected, the file is loaded when the app boots up. But on iOS the document never loads. Instead I get this message in the network tab of dev tools: The resource was requested insecurely. Changing the name to index.html makes it work properly.

What is expected to happen?

The document should load the entrypoint file that's specified by the <content> tag in config.xml.

What does actually happen?

The app builds but the document doesn't load. The html of the app just shows

<html>
  <head></head>
  <body></body>
</html>

Information

Command or Code

Create a new cordova project, rename the index.html file to main.html, then build the app.

Environment, Platform, Device

Using iPhone simulator (xcode 13) to run an iPhone 13 simulator running iOS 15.2

Version information

cordova ios v6.2.0, cordova cli 11

Checklist

jcesarmobile commented 2 years ago

On Slack you commented that you were using ionic webview plugin, have you tried without it?

CodeWithOz commented 2 years ago

Yes I tried without the plugin and it worked but on the file:// protocol.

jcesarmobile commented 2 years ago

cordova-ios 6.x also supports using schemes, I thought it was the default already, but looks like it was changed to default to file, so can you configure a scheme to use? i.e <preference name="scheme" value="ionic" /> (so it uses the same as ionic webview plugin and you don't lose any data)

msmtamburro commented 1 year ago

Schemes look like they're currently broken due to: https://github.com/apache/cordova-ios/issues/1223#issuecomment-1608211672

jcesarmobile commented 1 year ago

I've retested on cordova-ios 6.3.0 and it's working fine.