Menu

Absolute paths for assets in iOS & Android Cordova apps

DEV Community: cordova·Tyler Smith·7 months ago
#dTmsTNKi
#dev#preference#l222#issuecomment#class
Reading 0:00
15s threshold

There's an abundance of outdated information that states you can only use relative paths for assets in Cordova mobile apps. That information is incorrect: you can use absolute paths for assets in Cordova by configuring the scheme and hostname within config.xml . These configuration settings have been in Cordova for several years, and they are mentioned in the June 2020 Cordova version 6 release notes .

Here's what the Cordova documentation says about scheme and hostname :

Attributes Description

scheme

String

Android & iOS Default: Android: https

iOS: not defined , but falls back to app if the value is invalid.

Allowed values: Android: http or https

iOS: Any non-reserved schemes.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.