# wx.getGroupEnterInfo(Object object)

Start from base library version 2.10.4. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Not supported

Get the Mini Program startup information under the WeChat group chat scene. Group chat scene includes group chat Mini Program message card, group to do, group tool. That can be used to get the current group opengid。

# Note

  • Base library v2.10.4 Start Support for Getting Startup Information for Group Tools Mini Program
  • Base library v2.17.3 Start to support access to group chat Mini Program message cards, group to do Mini Program startup information

# parameter

# Object object

attribute type Default values Required Introductions
success function no Interface calls the successful callback function
fail function no Interface calls failed callback functions
complete function no Interface calls the end of the callback function (call success or failure will be executed)

# object.success callback

# parameter
# Object res
attribute type Introductions Minimum version
errMsg string Error message
encryptedData string Encrypted data for complete forwarding information including sensitive data, seeEncryption data decryption algorithm
iv string The initial vector of the encryption algorithm, seeEncryption data decryption algorithm
cloudID string Cloud of sensitive data ID, OpenCloud DevelopmentThe Mini Program will return, can directly access open data through the cloud call, seeDirect access to open data for cloud calls 2.7.0

# sample code

wx.getGroupEnterInfo({
  success(res) {
    // res
    {
      errMsg: 'getGroupEnterInfo:ok',
      encryptedData: '',
      IV: ''
    }
  },
  fail() {

  }
})

There are two ways to access sensitive data. One is to use [Encryption data decryption algorithm]((open-ability/signature#Encryption data decryption algorithm)) 。 Get the open data as follows json Structure in which opengid Unique identification for the current group):

{
 "opengid": "OPENGID"
}

# Development debugging

If you need to develop and debug wx.getGroupEnterInfo Interface, you can use the[Developer tools to simulate group chat scenarios](../../../devtools/different.md#Forwarding with group information)

# Tips

  • To display the group name, the Mini Program can use theOpen data component
  • Little games can be played through wx.getGroupInfo Interface gets group name