setOpenId

The setOpenId API is called by the super app to set the open ID, which is the user ID the super app returns in the memberInfoService SPI response. To retrieve and set the ID, you need to call this API after the IAPMiniProgram SDK has been initialized and the user logs in to the super app.

Method signature

copy
Future<void> setOpenId(String openId);

Request parameters

Field

Data type

Required

Description

openId

String

Yes

The unique ID that is assigned by the super app to identify a user. It corresponds to the value of the result.memberInfo.userId response parameter of the MemberInfoService SPI.

Response parameters

N/A

Error codes

N/A

Sample

copy
IAPMiniProgram.instance.setOpenId("123***789");