zoukankan      html  css  js  c++  java
  • iOS8远程通知处理

    // IOS8 新系统需要使用新的代码注册推送
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
    {
        [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings 
         settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)      
    categories:nil]];
        [[UIApplication sharedApplication] registerForRemoteNotifications];
    }
    else
    {
        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
         (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
    }

    判断PUSH是否打开的方法是:

     //判断推送是否开启

        if (isiOS8)

        {

            UIUserNotificationType type = [application currentUserNotificationSettings].types;

            if (type) {

            }else

            {

            }

             NSLog(@"------- 推送类型 ------%d",type);

        }

        else

        {

           UIRemoteNotificationType type = [application enabledRemoteNotificationTypes];

            if (type) {

            }else

            {

       }

             NSLog(@"------- 推送类型 ------%d",type);

        }

  • 相关阅读:
    unix网络编程源码编译问题
    ubuntu15.04下安装docker
    hexo博客的相关配置
    hexo的jacman主题配置
    使用github和hexo搭建静态博客
    操作系统简单认识
    github for windows安装以及教程
    编译原理第五单元习题
    python3入门之列表和元组
    Python3入门之软件安装
  • 原文地址:https://www.cnblogs.com/zhujin/p/3986000.html
Copyright © 2011-2022 走看看