Skip to content

Commit

Permalink
♻️ Update push verifier to open app settings if push permission denied
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed May 6, 2024
1 parent 240e90e commit 0ced779
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/AppcuesKit/Presentation/Debugger/PushVerifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal class PushVerifier {
case .notAuthorized:
return "Error 2: Notification permissions not requested"
case .permissionDenied:
return "Error 3: Notification permissions denied"
return "Error 3: Notification permissions denied. Tap to open system settings"
case .unexpectedStatus:
return "Error 4: Unexpected notification permission status"
case .noNotificationDelegate:
Expand Down Expand Up @@ -117,6 +117,12 @@ internal class PushVerifier {
return
}

if errors.contains(.permissionDenied), let settingsURL = URL(string: "app-settings://") {
errors = []
UIApplication.shared.open(settingsURL)
return
}

errors = []

verifyDeviceConfiguration()
Expand Down

0 comments on commit 0ced779

Please sign in to comment.