journey.files
Version compatibility
journey.files
was introduced with version 4.80.0 of the JourneyApps Runtime.
Ability to interact with files in JourneyApps.
Property | Description | Example |
---|---|---|
| Saves a file to the device. Note: Due to limitations on mobile file systems, this method is only supported on Desktop and Web. | |
| Opens a file viewer in-app to display an attachment. Note: Supported file types: | |
| Opens the default file viewer (based on media type) of the device to display an attachment. Supported file types for RealWear: Note:
|
Examples
journey.files.saveFile
journey.files.saveFile
journey.files.viewFile(data, filename)
where data
is the string
or ArrayBuffer
to save to the file, and filename
is a string
containing the name of the file created.
Saving a string
:
Saving a photo
:
journey.files.viewFile
journey.files.viewFile
journey.files.openFileExternally
journey.files.openFileExternally
TypeScript apps
journey.files.openFileExternally
requires version 2.0.2 or greater of the@journeyapps/runtime-build
package.
Synced state
Ensure that the attachment
is synced, by calling journey.synchronize()
before either journey.files.viewFile
or journey.files.openFileExternally
.
Last updated