Skip to content

Commit 57b2438

Browse files
committed
update doc
1 parent aa236f7 commit 57b2438

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

example/documents/APIs_zh.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [接收推送事件](#接收推送事件)
1313
- [接收自定义消息事件](#接收自定义消息事件)
1414
- [iOS Only API](#ios-only-api)
15+
- [setupPush](#setuppush)
1516
- [setBadge](#setbadge)
1617
- [getBadge](#getbadge)
1718
- [setLocalNotification](#setlocalnotification)
@@ -220,6 +221,17 @@ Android 和 iOS 通用 API。
220221

221222
### iOS Only API
222223

224+
#### setupPush
225+
226+
调用这个接口会向系统注册推送功能(会弹出推送权限请求),注意使用自动配置会自动在 `AppDeletate.m` 插入注册代码如下,如果不希望在应用启动的时候就向用户申请权限可以删掉这部分代码。
227+
228+
```objective-c
229+
// AppDelegate.m 自动插入的代码
230+
JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
231+
entity.types = UNAuthorizationOptionAlert|UNAuthorizationOptionBadge|UNAuthorizationOptionSound;
232+
[JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
233+
```
234+
223235
#### setBadge
224236
225237
设置应用 badge 值,该方法还会同步 JPush 服务器的的 badge 值,JPush 服务器的 badge 值用于推送 badge 自动 +1 时会用到。

0 commit comments

Comments
 (0)