Menu

📰
0

Absolute paths for assets in iOS & Android Cordova apps

DEV Community: cordova·Tyler Smith·about 1 month ago
#dTmsTNKi
#dev#preference#l222#issuecomment#class#code
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. ( Example Reserved Schemes ) This property contains the scheme which your app content is served from. hostname String Android & iOS Default: localhost This property contains the hostname which the app content is served from. If the preference scheme is not defined for iOS, the hostname value will be ignored.…

Continue reading — create a free account

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

Read More