-1
以下のコードを使用して、ユーザーがプッシュ通知を有効にしているかどうかを検出しました。ユーザーが有効にした後にプッシュ通知設定ページに戻る方法
**Problem**.
1) How to open or navigate to the Push Notification setting Page in the phone
2) How to return from this Push Notification page after user enabled it or
how user return to previous page if decide to enable later.
VC_Check --> Push Notification settings
in VC_check:
if UIApplication.shared.isRegisteredForRemoteNotifications {
print("YES")
// goto other VC
} else {
// goto Phone setting page
}
//-- I dont want this Pop Up to enable Push Notification:
// detected not enabled, use below pop Up
pageUIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil))
UIApplication.shared.registerForRemoteNotifications()
助けてください。
おかげ