[IOS8相容性]IOS8上收不到通知

來源:互聯網
上載者:User

標籤:blog   io   os   ar   使用   for   sp   div   on   

應用中用到了通知功能,同時有遠程通知和本地通知。

測試報告應用在iphone6 plus上,收不到本地通知。

 

因為所有的第三方鬧鐘應用採用的都是本地通知方式,所以第一時間隨機下載了5款不同的鬧鐘應用。所有的應用都同樣無法正常工作。

當時已是深夜,QA這關算是暫時交待過去了。

 

等到遞交結束後,這個問題總歸得解決。查詢得知,在iOS8上,需要使用新的註冊通知方法。

替換原來的代碼,使用

    if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)]) {        [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeSound|UIUserNotificationTypeBadge                                                                                                              categories:nil]];    }    else{        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:         (UIRemoteNotificationTypeAlert |          UIRemoteNotificationTypeBadge |          UIRemoteNotificationTypeSound)];    }

 問題徹底解決。

[IOS8相容性]IOS8上收不到通知

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.