Sailfish Share
API DocumentationShareResource QML Type
Import Statement: | import Sailfish.Share 1.0 |
Properties
Detailed Description
Type for resources from ShareProvider::triggered. This type can not be created directly from QML.
Resources can have two different types: ShareResource.StringDataType
and ShareResource.FilePathType
. Depending on which type the resource is, different properties can be accessed. ShareResource::type can be always accessed.
Property Documentation
This is the content of the shared resource if resource's type is ShareResource.StringDataType
.
This is a path to the shared file if resource's type is ShareResource.FilePathType
.
This is the name of the shared resource if resource's type is ShareResource.StringDataType
.
ShareResource's type. Either ShareResource.StringDataType
or ShareResource.FilePathType
.
You may alter your application's behaviour based on this value:
function handleResource(resource) { if (resource.type === ShareResource.FilePathType) { handleSharedFilePath(resource.filePath) } else if (resource.type === ShareResource.StringDataType) { handleSharedData(resource.name, resource.data) } else { console.warn("Unknown resource type:", resource.type) showSharingError() } }