journey.files
Version compatibility
journey.files
was introduced with version 4.80.0 of the JourneyApps Runtime.
Ability to interact with files in JourneyApps.
saveFile
Saves a file to the device.
Note: Due to limitations on mobile file systems, this method is only supported on Desktop and Web.
viewFile
Opens a file viewer in-app to display an attachment.
Note: Supported file types: .jpg/.jpeg
, .png
, and pdf
.
openFileExternally
Opens the default file viewer (based on media type) of the device to display an attachment. Supported file types for RealWear: .jpg/.jpeg
, .png
, .bmp
, .webp
, .gif
, .pdf
.
Note:
Supported in JourneyApps Container version 22.2.1 and Runtime version 4.84.0 and later.
This method is currently not supported on Web.
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