iOS端推送服务向用户请求权限是否像请求位置服务/相机服务那样需要写一个隐私描述?

问题详述

iOS端推送服务向用户请求权限是否像请求位置服务/相机服务那样需要写一个隐私描述?

问题解答

不需要,只需在代码中注册苹果推送就可以了 。

  1. /**
  2. * 注册苹果推送,获取deviceToken用于推送
  3. * @param application
  4. */
  5. - (void)registerAPNS:(UIApplication *)application {
  6. if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
  7. // iOS 8 Notifications
  8. [application registerUserNotificationSettings:
  9. [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
  10. [application registerForRemoteNotifications];
  11. } else {
  12. // iOS < 8 Notifications
  13. [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
  14. }
  15. }

具体可参考 iOS 推送接入文档