Taro.getShareInfo(option)
Gets forwarding details.
Tips
- To display the group name, use open data components.
Type
(option: Option) => Promise<SuccessCallbackResult>
Parameters
Option
Property | Type | Required | Description |
---|---|---|---|
shareTicket | string | Yes | shareTicket |
timeout | number | No | Timeout (in ms) |
complete | (res: any) => void | No | The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail | (res: any) => void | No | The callback function for a failed API call |
success | (res: Result) => void | No | The callback function for a successful API call |
SuccessCallbackResult
Property | Type | Description |
---|---|---|
cloudID | string | The Cloud ID corresponding to sensitive data. It is returned only in Mini Programs for which Cloud Base is enabled. The open data can be directly obtained via cloud call. See Detail. |
encryptedData | string | The complete encrypted forwarding data, including sensitive data. For details, seeDecryption Algorithm for Encrypted Data |
errMsg | string | Error message |
iv | string | The initial vector of the encryption algorithm. For details, see Decryption Algorithm for Encrypted Data |
Sample Code
There are two ways to get sensitive data. One is to use the Decryption Algorithm for Encrypted Data. The acquired open data has the following json structure (in which, openGId is the unique identifier of the current group):
{
"openGId": "OPENGID"
}
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.getShareInfo | ✔️ |