zoukankan      html  css  js  c++  java
  • iOS中判断消息推送是否打开

    根据 [[UIApplication sharedApplication] enabledRemoteNotificationTypes] 的返回值来进行判断,该返回值是一个枚举值,如下:
    typedef enum {
        UIRemoteNotificationTypeNone    = 0,
        UIRemoteNotificationTypeBadge   = 1 << 0,
        UIRemoteNotificationTypeSound   = 1 << 1,
        UIRemoteNotificationTypeAlert   = 1 << 2,
        UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3,
    } UIRemoteNotificationType;
    如果是 UIRemoteNotificationTypeNone ,则可以认为推送开关没有打开,反之亦然。
     
     
    update
    ios8以后以上方法废弃
    使用

     UIUserNotificationSettings *settings = [[UIApplication sharedApplication]currentUserNotificationSettings];

                if (settings.types==UIUserNotificationTypeNone) {

                    //关闭了

                }

     

  • 相关阅读:
    springboot之session、cookie
    Springboot的异步线程池
    spring自带的定时任务功能@EnableScheduling
    SpringBoot+SpringCloud实现登录用户信息在微服务之间的传递
    sss
    sss
    sss
    sss
    sss
    sss
  • 原文地址:https://www.cnblogs.com/cc412/p/4939488.html
Copyright © 2011-2022 走看看