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

        }

  • 相关阅读:
    eslint自动格式化
    焕肤功能
    Web Components
    Webpack 中的 sideEffects
    andriod 新建Activity_ Form
    那么唯美
    C# PDF添加水印
    停止触发器
    sp_sys_ERPTrigger_base
    sql语句返回主键SCOPE_IDENTITY()
  • 原文地址:https://www.cnblogs.com/zhujin/p/3986000.html
Copyright © 2011-2022 走看看