Skip to main content
Version: Next

Taro.getShareInfo(option)

Gets forwarding details.

Tips

Reference

Type

(option: Option) => Promise<SuccessCallbackResult>

Parameters

Option

PropertyTypeRequiredDescription
shareTicketstringYesshareTicket
timeoutnumberNoTimeout (in ms)
complete(res: any) => voidNoThe callback function used when the API call completed (always executed whether the call succeeds or fails)
fail(res: any) => voidNoThe callback function for a failed API call
success(res: Result) => voidNoThe callback function for a successful API call

SuccessCallbackResult

PropertyTypeDescription
cloudIDstringThe 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.
encryptedDatastringThe complete encrypted forwarding data, including sensitive data. For details, seeDecryption Algorithm for Encrypted Data
errMsgstringError message
ivstringThe 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

APIWeChat Mini-ProgramH5React Native
Taro.getShareInfo✔️