share
Requires:
BizKit≥3.0.0@ray-js/ray≥0.3.23
Platforms:
iOS
Method signature
share(params: )Minimum SDK versions
- iOS
ThingSmartBizKitBizBundle - ≥ 5.2.1
- Android
com.thingclips.smart:thingsmart-bizbundle-bizkit - ≥ 5.2.0
Description
Share text, images, files, web pages, or mini program content via the specified channel
Parameters
| Property | Type | Required | Default | Description | Minimum SDK versions |
|---|---|---|---|---|---|
type | "WeChat" | "Message" | "Email" | "More" | No | 'WeChat' | Share channel; defaults to WeChat if omitted. Options: WeChat, Message, Email, More | — |
title | string | Yes | - | title Title | — |
message | string | Yes | - | message Text content | — |
contentType | "text" | "image" | "file" | "web" | "miniProgram" | No | 'text' | contentType Content type | — |
recipients | string[] | No | - | recipients Email/SMS recipients | — |
imagePath | string | No | - | imagePath Image path | — |
filePath | string | No | - | File share path, used when contentType == file; omitting it will cause the file share to fail | — |
webPageUrl | string | No | - | web Used when contentType == file | — |
| No | - | miniProgramInfo Used when contentType == miniProgram, and the share channel must be WeChat. | — | ||
complete | () => void | No | - | Completion callback (executed on both success and failure) | — |
success | () => void | No | - | Callback on successful API call | — |
fail | (params: Object) => void | No | - | Failure callback | — |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None
Valid Values
type
| Value | Description | BizKit Since |
|---|---|---|
WeChat | v4.14.8 | |
Message | SMS | v4.14.8 |
Email | v4.14.8 | |
More | More system share options (invoke system share) | v4.14.8 |
contentType
| Value | Description | BizKit Since |
|---|---|---|
text | Text | v4.14.8 |
image | Image | v4.14.8 |
file | File | v4.14.8 |
web | Web page URL | v4.14.8 |
miniProgram | WeChat Mini Program share content | v4.14.8 |