-
Notifications
You must be signed in to change notification settings - Fork 91
Assets
Warning
This page is still being written.
Contents
All assets that should be embedded in the final app bundle must be declared in app.json
under the resources
field. Unless stated otherwise, assets are copied as-is into the app bundle as raw assets.
Read on to learn how we handle certain resource types.
When the app is instructed to load the embedded JS bundle, it will look for and load the first file it finds from the list, starting from the top:
index.[platform].jsbundle
main.[platform].jsbundle
index.mobile.jsbundle
main.mobile.jsbundle
index.native.jsbundle
main.native.jsbundle
index.jsbundle
main.jsbundle
You can tell RNTA to use a different filename by configuring bundleRoot
.
When loading from the dev server, the app will attempt to load http://localhost:8081/index.bundle
by default.
Warning
Not yet implemented!
This is just a draft of how we think it should work. If you have any feedback, leave them in the linked issue.
Fonts are copied into a specific location designated for fonts. The filename (without its extension) is used as resource id.
- Documentation:
ReactFontManager.java
(additional info: Font resources) - Location:
assets/fonts
- Supported file types:
.ttf
,.otf
Tracking issue: #1813
Fonts are copied as-is into the app bundle, but must be registered in Info.plist
before they can be used. Note that the font name may not match the filename. Check the documentation for how to find the font name.
- Documentation: Adding a Custom Font to Your App
- Location:
/
- Supported file types:
.ttf
,.otf
Tracking issue: #1185
Fonts are copied as-is into the app bundle, but must be registered in Info.plist
before they can be used.
- Documentation:
ATSApplicationFontsPath
- Location:
/
- Supported file types: ?
Tracking issue: #1185
???
Warning
Not yet implemented!
This is just a draft of how we think it should work. If you have any feedback, leave them in the linked issue.
Note
This only applies to images in a hybrid app. In most cases, you should let React Native manage images: https://reactnative.dev/docs/next/images
Images are copied into a specific location designated for bitmaps. The filename (without its extension) is used as resource id.
- Documentation: Drawable resources/Bitmap
- Location:
res/drawable
- Supported file types:
.png
,.webp
,.jpg
, or.gif
Tracking issue: #1813
Warning
Not yet implemented!
This is just a draft of how we think it should work. If you have any feedback, leave them in the linked issue.
Supported media files are copied into a specific location designated for raw resources.
- Documentation: Supported media formats
- Location:
res/raw
- Supported file types:
.3gp
,.aac
,.amr
,.flac
,.imy
,.m4a
,.mid
,.mkv
,.mp3
,.mp4
,.mxmf
,.ogg
,.ota
,.rtttl
,.rtx
,.ts
,.wav
,.webm
,.xmf
Tracking issue: #1813