Share Procedure
The Plugin API Framework has been extended with the new share procedure that allows you to save and send files that you uploaded from your device or files that were generated by plugins themselves.
Integrators can use the share procedure to address the following scenarios:
- Send text or any type of files through natively available options, such as Outlook, Gmail, WhatsApp, AirDrop, Google Drive, and so on (the application must be installed on your device) using the mobile device with installed iOS or Android Oracle Field Service applications or browser application.
- Save any types of files to the gallery using a mobile device through the installed iOS or Android Oracle Field Service application or the Oracle Field Service web application.
- Save any types of files to the local computer using a desktop browser (Sending is not supported on desktop devices).
- Open files with the applications available on the mobile device.
This share procedure is supported in both online and offline modes.
By calling the share procedure, the Plugin API validates parameters and calls the native (device or browser) share functionality with those provided parameters. The plugin API doesnt return info about or respond to problems such as cancellation, no printer, and so on.
Example of the "callProcedure" message:
{
"apiVersion": 1,
"method": "callProcedure",
"procedure": "share",
"callId": "123abc",
"params": {
"title": "Some text string",
"fileObject": "fileObject",
"text": "Some text string"
}
}
Oracle Field Service sends the "resultData" message in response to the "share" message only if there are no validation errors.
Example of the "callProcedureResult" message:
{
"apiVersion": 1,
"method": "callProcedureResult",
"callId": "123abc",
"resultData": {
"status": "ok"
}
}
Share procedure parameters:
Parameters of share procedure are as follows:
This table lists the details of each parameter such as the value, whether the parameter is required, and description:
Parameter | Value | is Required | Description |
---|---|---|---|
title | string | yes | text string to be shared |
fileObject | fileObject | required only if the 'text' parameter is empty | value from input file with max size 50MB (51200kb) for file |
text | string | required only if the 'fileObject' parameter is empty | text string to be shared with max length equal to 50MB (51200kb) |
If the parameter fileObject is empty but the text parameter is not empty, then the title is used like a file name to send (on mobile devices) or save (on desktop).
Supported File Types
There are no restrictions of the file format for the share option. All file types supported by default web sharing API - https://www.w3.org/TR/web-share/
Validation
If an error appears then no actions have been applied.