Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_68066342
uni-app
提交
808f1f3e
U
uni-app
项目概览
m0_68066342
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
808f1f3e
编写于
12月 24, 2019
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: 新增微信小程序订阅消息文档
上级
360bf98f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
0 deletion
+50
-0
docs/api/_sidebar.md
docs/api/_sidebar.md
+1
-0
docs/api/other/requestSubscribeMessage.md
docs/api/other/requestSubscribeMessage.md
+49
-0
未找到文件。
docs/api/_sidebar.md
浏览文件 @
808f1f3e
...
...
@@ -123,6 +123,7 @@
*
[
统计
](
api/other/report.md
)
*
[
卡券
](
api/other/card.md
)
*
[
模板消息
](
api/other/template.md
)
*
[
订阅消息
](
api/other/requestSubscribeMessage.md
)
*
[
小程序更新
](
api/other/update.md
)
*
[
调试
](
api/other/set-enable-debug.md
)
*
[
获取第三方平台数据
](
api/other/get-extconfig.md
)
...
...
docs/api/other/requestSubscribeMessage.md
0 → 100644
浏览文件 @
808f1f3e
### uni.requestSubscribeMessage(Object object)
**平台差异说明**
|5+App|H5 |微信小程序 |支付宝小程序 |百度小程序 |头条小程序 |QQ小程序 |
|:-: |:-:|:-: |:-: |:-: |:-: |:-: |
|x |x |基础库版本>=2.8.2|x |x |x |x |
**object参数说明**
|属性 |类型 |默认值 |必填 |说明 |
|:-: |:-: |:-: |:-: |:-: |
|tmplIds |Array | |是 |需要订阅的消息模板的id的集合,一次调用最多可订阅3条消息(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置 |
|success |function | |否 |接口调用成功的回调函数 |
|fail |function | |否 |接口调用失败的回调函数 |
|complete |function | |否 |接口调用结束的回调函数(调用成功、失败都会执行) |
**注意**
-
用户发生点击行为或者发起支付回调后,才可以调起订阅消息界面
**平台说明**
-
[
微信小程序订阅消息参考文档
](
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html
)
**object.success 返回值**
|属性 |类型 |说明 |
|:-: |:-: |:-: |
|errMsg |String |接口调用成功时errMsg值为'requestSubscribeMessage:ok' |
|TEMPLATE_ID|String| [TEMPLATE_ID]是动态的键,即模板id,值包括'accept'、'reject'、'ban'。'accept'表示用户同意订阅该条id对应的模板消息,'reject'表示用户拒绝订阅该条id对应的模板消息,'ban'表示已被后台封禁。例如 { errMsg: "requestSubscribeMessage:ok", zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: "accept"} 表示用户同意订阅zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE这条消息|
**object.fail 返回值**
|属性 |类型 |说明 |
|:-: |:-: |:-: |
|errMsg |String |接口调用失败错误信息 |
|errCode|Number |接口调用失败错误码 |
**示例代码**
```
uni.requestSubscribeMessage({
tmplIds: [''],
success (res) { }
})
```
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录