问题详述
iOS端推送服务向用户请求权限是否像请求位置服务/相机服务那样需要写一个隐私描述?
问题解答
不需要,只需在代码中注册苹果推送就可以了 。
/**
* 注册苹果推送,获取deviceToken用于推送
* @param application
*/
- (void)registerAPNS:(UIApplication *)application {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
// iOS 8 Notifications
[application registerUserNotificationSettings:
[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[application registerForRemoteNotifications];
} else {
// iOS < 8 Notifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
}
}
具体可参考 iOS 推送接入文档 。
文档内容是否对您有帮助?