zoukankan      html  css  js  c++  java
  • registerForRemoteNotificationTypes: is not supported in iOS 8.0 and

    注册模式:

    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
            [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings
                                                                                 settingsForTypes:(UIUserNotificationTypeSound |
                                                                                                   UIUserNotificationTypeAlert |
                                                                                                   UIUserNotificationTypeBadge)
                                                                                 categories:nil]];
            [[UIApplication sharedApplication] registerForRemoteNotifications];
            
        }
        else {
            [[UIApplication sharedApplication]registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|
                                                                                UIRemoteNotificationTypeBadge|
                                                                                UIRemoteNotificationTypeSound]; 
        }
    


    同理推断消息推送是否打开也有变化

    UIRemoteNotificationType types;
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
        types = [[UIApplication sharedApplication] currentUserNotificationSettings].types;
    else
        types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
    return (types & UIRemoteNotificationTypeAlert);
    



    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    android activity lifecycle
    android hal 分析
    android hardware.c 源码分析
    linux cpio
    android boot.img unpack pack
    imx6 android4.2 编译
    repo 安装
    repo manifest.xml 分析
    ElasticSearch 5.0.0 安装部署常见错误或问题
    elasticsearch 安装(基于java运行环境)
  • 原文地址:https://www.cnblogs.com/blfshiye/p/4681905.html
Copyright © 2011-2022 走看看