File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 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 时会用到。
You can’t perform that action at this time.
0 commit comments