2
私のアプリケーションでは、私はローカルの通知システムを実装しようとしている。次のように通知をスケジュールする通知は音を出すが何も表示しない
私のコードは次のとおりです。
func scheduleNotification(_ Name:String, _ Time:DateComponents){
let center = UNUserNotificationCenter.current()
let notification = UNMutableNotificationContent()
notification.title = Name
notification.sound = UNNotificationSound.default()
var trigger = UNCalendarNotificationTrigger(dateMatching: Time, repeats: false)
let identifier = Name
let request = UNNotificationRequest(identifier: identifier, content: notification, trigger: trigger)
center.add(request)
}
さて、昨日働いたが、それはもはやいないこと。シミュレータとデバイスの両方で。
私は無駄にここでの提案を試してみた:Local Notifications make sound but do not display (Swift)私が試してみました何
:アプリの力で
- テストを背景
- におけるアプリで
- テストを閉じました識別子の変更
ありがとう、これは私の問題を解決した – Will
大歓迎男 –