HomeDocs
Skip to main content

dlt.systemShare

Introduction

This API allows you to use the Android system's sharing capabilities. It provides the ability to share content through various channels supported by the system. This API is only open to internal use.

Usage Limitations

This feature is supported from the base library version 3.0.0 or higher.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
shareContentstringNoThe text content to be shared
shareFilePathstringNoThe file path of the content to be shared (image, video, file)
successfunctionNoCallback function when the interface is successfully called
failfunctionNoCallback function when the interface call fails
completefunctionNoCallback function when the interface call ends (executed whether successful or failed)

Note: Either one of the two parameters is required. If both shareFilePath and shareContent are not empty, priority will be given to shareFilePath . If the file is found, it will be shared. If the file is not found, the text content will be shared.

object.success callback function

Parameters

Object res

PropertyTypeDescription
successstringtrue - Setting success

object.fail callback function

Parameters

Object res

PropertyTypeDescription
successstringfalse-failed
errMsgstringError message:
1. Parameter error: S10001
2. Share File Failed, no write permission: S10002
3. ShareContent is empty: S10003
4. Share Failed: S10004

Sample Code

// pages/index/index.js
Page({
share() {
dlt.systemShare({
shareContent: 'hello world',
shareFilePath: 'images/xxx.png'
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.