獲取應用在ios系統通知中心的設置?開啓:關閉

根據 [[UIApplication sharedApplication] enabledRemoteNotificationTypes] 的返回值來進行判斷,該返回值是一個枚舉值,如下:
typedef enum {
    UIRemoteNotificationTypeNone    = 0,
    UIRemoteNotificationTypeBadge   = 1 << 0,
    UIRemoteNotificationTypeSound   = 1 << 1,
    UIRemoteNotificationTypeAlert   = 1 << 2,
    UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3,
} UIRemoteNotificationType;
如果是 UIRemoteNotificationTypeNone ,則可以認爲推送開關沒有打開,反之亦然。

//獲取到 系統通知中心的設置

    UIRemoteNotificationType  type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章