# SubscriptionsSetting

Subscription Message Settings

# attribute

# Boolean mainSwitch

Subscription message master switch, true on, false off

# Object itemSettings

The subscription status of each subscription message. The key of the itemSettings object isTemplate id for one-time subscription messagesorType of system subscription messageWith values of 'accept', 'reject', or 'ban'. 'accept 'means that the user agrees to subscribe to the message,' reject 'means the user refuses to subscribe, and' ban 'means it has been blocked in the background. See how to use one-time subscription messages wx.requestSubscribeMessage, permanent subscription message (available for small games only)wx.requestSubscribeSystemMessage

# Note

  • itemSettings Only returns a subscription message where the user has checked "Always keep above selection, no longer ask" in the subscription panel.

# sample code

wx.getSetting({
  withSubscriptions: true,
  success (res) {
    console.log(res.authSetting)
    // res.authSetting = {
    //   "scope.userInfo": true,
    //   "scope.userLocation": true
    // }
    console.log(res.subscriptionsSetting)
    // res.subscriptionsSetting = {
    //   mainSwitch: true, // Subscription message master switch
    //   itemSettings: {   // Every switch
    //     SYS_MSG_TYPE_INTERACTIVE: 'accept', // Small game system subscription message
    //     SYS_MSG_TYPE_RANK: 'accept'
    //     zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: 'reject', // General one-time subscription messages
    //     Wed_OZC_66gZxALLcsuI7ilCJSP2OJ2vWo2ooUPpkWrw: "Class"
    //   }
    // }
  }
})