1

UNUserNotificationCenterが有効になっていれば、userNotificationCenter機能も有効になっていることを確認しました。swift userNotificationCenterチェック識別子

したがって、userNotificationCenter関数の識別子を確認し、識別子に従って通知を変更します。 UNUserNotificationCenter機能で

1.Howアラーム内容変更するUNUserNotificationCenter機能

2.Howに識別子を確認する(例えば、タイトルを...)

いくつかの方法は何ですか?

+0

受信した通知の識別子を確認しますか? – bhakti123

答えて

0
func userNotificationRequestAuthorization() { 
    let center = UNUserNotificationCenter.current() 
    center.requestAuthorization(options: [.alert, .sound], completionHandler: { (granted, error) in 
     if granted { 
     //do something 
     } 
    }) 
    }