Skip to main content

bn.requestSubscribeMessage

requestSubscribeMessage(option): Promise<RequestSubscribeMessageSuccessCallbackResult>

remark support jssdk >= 3.13.0

description Set up the client Mini Program subscription message interface and return the result of user subscription message.

example

// usage
const res = await bn.requestSubscribeMessage({
tmplIds: ['tmplid-1afXeq4c', 'tmplid-unDYd3gc']
})
Object.entries(res).forEach(([id, result]) => {
if (result.type === 'accept') {
console.log(id, result.token)
}
})

Parameters

NameTypeDescription
optionRequestSubscribeMessageOptionan option object include tmplIds to subscribe

Returns

Promise<RequestSubscribeMessageSuccessCallbackResult>

A result object which key is a tmplId and value is the subscribe result for the tmplId.

Interface: RequestSubscribeMessageOption

NameTypeDescription
tmplIdsstring[]the list of template ids to subscribe

Interface: RequestSubscribeMessageSuccessCallbackResult

NameTypeDescription