From 5cea6141c4daa16816f16ea47fa6dfc86f4db29f Mon Sep 17 00:00:00 2001 From: Srinidhi Date: Sun, 29 Sep 2019 16:52:11 +0530 Subject: [PATCH] docs(unvired-cordova-sdk): update doc (#3171) * feat(unvired-cordova-sdk): support login via email * fix(unvired-cordova-sdk): return typed promise object for user settings * fix(unvired-cordova-sdk): change return type to string for guid() * doc(unvired-cordova-sdk): doc update * doc(unvired-cordova-sdk): update doc * feat(unvired-cordova-sdk): add support for metadata JSON * doc(unvired-cordova-sdk): update doc * doc(unvired-cordova-sdk): update doc --- .../plugins/unvired-cordova-sdk/index.ts | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts b/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts index 23bc9fd96..076f9da6b 100644 --- a/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts +++ b/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts @@ -964,12 +964,29 @@ export class UnviredCordovaSDK extends IonicNativePlugin { } /** - * Copy attachment file to application folder and insert attachment item to database with updated local path. - * @param tableName Table name of attachment item. - * @param structureObject {Object} JSON object containing name-value pairs. + * Saves attachment item in database and prepares it for uploading to server. This api is required to associate attachment file to a Business Entity. + * This api copies the attachment file to a new path, links the attachment with the header in database. + * To send the attachment item, just send the header using either syncForeground / syncBackground api and sdk will upload all the linked attachments. + * @param tableName Table name of attachment item structure. This usually ends with _ATTACHMENT. + * @param structureObject {Object} attachment item as a JSON object. Please check the example below. * Example: * ``` - * {'F_NAME':'USER','EMP_NO':'0039'} + * // Steps to upload attachment. + * // 1. Store the file to be attached in device's path. + * // 2. Create an attachment item to send this file. + * var attachmentObject = new INSPECTION_ATTACHMENT() + * attachmentObject.LID = guid(); // Random id + * attachmentObject.FID = lid // LID of the header. + * attachmentObject.UID = guid(); // Random id + * attachmentObject.EXTERNAL_URL = ""; // Optional: Check with your Unvired Process agent developer. + * attachmentObject.FILE_NAME = 'myfile.jpg'; // Name of the file as stored in the device. + * attachmentObject.LOCAL_PATH = //myfile.jpg // File path. Please make sure that the path starts with a '/' + * attachmentObject.TAG1 = '' // Optional: Check with your Unvired Process agent developer. + * attachmentObject.TAG2 = '' // Optional: Check with your Unvired Process agent developer. + * attachmentObject.TAG2 = '' // Optional: Check with your Unvired Process agent developer. + * attachmentObject.TAG4 = '' // Optional: Check with your Unvired Process agent developer. + * attachmentObject.TAG5 = '' // Optional: Check with your Unvired Process agent developer. + * await this.unviredCordovaSDK.createAttachmentItem('INSPECTION_ATTACHMENT', attachmentObject) * ``` */ @Cordova()