Skip to content

Commit 76d6c5d

Browse files
committed
更新文档
1 parent 521422c commit 76d6c5d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

doc/Common_detail_api.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
- [cleanTags](#cleantags)
2222
- [getAllTags](#getalltags)
2323
- [checkTagBindState](#checktagbindstate)
24+
- [设置手机号](#设置手机号)
25+
- [setMobileNumber](#setMobileNumber)
2426
- [获取点击通知内容](#获取点击通知内容)
2527
- [event - jpush.openNotification](#event---jpushopennotification)
2628
- [获取通知内容](#获取通知内容)
@@ -396,6 +398,37 @@ window.JPush.checkTagBindState({ sequence: 1, tag: 'tag1' },
396398
- sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。
397399
- tag: string,待查询的 tag。
398400

401+
## 设置手机号
402+
403+
提供设置手机号码的接口,用于短信补充功能。
404+
405+
注:短信补充仅支持国内业务,号码格式为 11 位数字,有无 +86 前缀皆可。
406+
407+
### setMobileNumber
408+
409+
调用此 API 设置手机号码。该接口会控制调用频率,频率为 10s 之内最多 3 次。
410+
411+
#### 代码示例
412+
413+
```js
414+
window.JPush.setMobileNumber({ sequence: 5, mobileNumber: '111111' },
415+
(result) => {
416+
var sequence = result.sequence
417+
var number = result.mobileNumber
418+
}, (error) => {
419+
var sequence = error.sequence
420+
var errorCode = error.code
421+
})
422+
```
423+
424+
#### 参数说明
425+
426+
- sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。
427+
- mobileNumber: string
428+
- 手机号码。如果传空串则为解除号码绑定操作。
429+
- 限制:只能以 “+” 或者 数字开头;后面的内容只能包含 “-” 和数字。
430+
431+
399432
## 获取点击通知内容
400433

401434
### event - jpush.openNotification

0 commit comments

Comments
 (0)