UILocalNotification issue with iOS9

前端 未结 4 1260
不思量自难忘°
不思量自难忘° 2021-02-20 14:38

Since iOS9, local notification aren\'t working properly. Sometimes users receive the notification, sometimes they just don\'t. My notifications are repeated daily. Any idea what

4条回答
  •  盖世英雄少女心
    2021-02-20 15:31

    if You need it for iOS9 but under swift 3.1:

    final func registerToGetLocalNotificationsFor_iOS9(){
        let types : UIUserNotificationType = [.sound, .alert /*, .badge*/]
        let mySettings = UIUserNotificationSettings(types: types, categories: nil)
        UIApplication.shared.registerUserNotificationSettings(mySettings)
    
    }
    

    on iOS10 is deprecated.

提交回复
热议问题