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);

        }

  • 相关阅读:
    MVC 数据库增删改查(2) 视图
    MVC 数据库增删改查(1)
    委托的4种写法
    wpf 多线程操作(2)
    wpf 多线程操作例(1)
    网络抓取邮箱
    wpf 点击新建弹出新的窗口
    wpf 数据绑定 联系
    wpf 在listview里添加数据
    面向对象:抽象基类,接口
  • 原文地址:https://www.cnblogs.com/zhujin/p/3986000.html
Copyright © 2011-2022 走看看