-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add toggling of NetP Notifications to iOS #2112
Conversation
.padding(.top, statusModel.error == nil ? 0 : -20) | ||
.animation(.default, value: statusModel.shouldShowConnectionDetails) | ||
.if(statusModel.animationsOn, transform: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The animation bug this fixes became a lot more noticeable with the addition of the new section. So I fixed it here.
static var networkProtectionGroupDefaults: UserDefaults { | ||
let suiteName = "\(Global.groupIdPrefix).netp" | ||
guard let defaults = UserDefaults(suiteName: suiteName) else { | ||
fatalError("Failed to create netP UserDefaults") | ||
} | ||
return defaults | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I suspect I'll be using this for the widget - thanks!
private static let notificationSettingsURL: URL? = { | ||
let settingsString: String | ||
if #available(iOS 16, *) { | ||
settingsString = UIApplication.openNotificationSettingsURLString | ||
} else if #available(iOS 15.4, *) { | ||
settingsString = UIApplicationOpenNotificationSettingsURLString | ||
} else { | ||
settingsString = UIApplication.openSettingsURLString | ||
} | ||
return URL(string: settingsString) | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. We have some notification handling code that exists for the waitlist, but I don't think it's as complete as this - I'll keep this in mind for the next waitlist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, and works as expected - nice one!
Co-authored-by: Sam Symons <[email protected]>
…ification-settings
* develop: Alert user about abnormal app conditions (#2110) Add e2e test for email protection deep-links (#2123) Update to config v4 (#2114) Release 7.95.0 (#2122) Add toggling of NetP Notifications to iOS (#2112) Fix for deeplink crash when preparing webview preview (#2116) Integrates the latest DBP changes in BSK (#2108) Switch to next phase of new experiment for UA (#2118)
* develop: re-enable keyboard shortcuts (#2132) fix favorite launch with keyboard bug (#2131) Fix syncing empty favorites folders (#2121) kill variant when receiving atb update (#2130) Adding 'protectionsState' to breakage form submission (#2120) Release 7.96.0 (#2128) Update remote messaging production url (#2124) Alert user about abnormal app conditions (#2110) Add e2e test for email protection deep-links (#2123) Update to config v4 (#2114) Release 7.95.0 (#2122) Add toggling of NetP Notifications to iOS (#2112) Fix for deeplink crash when preparing webview preview (#2116) Integrates the latest DBP changes in BSK (#2108) Switch to next phase of new experiment for UA (#2118)
* develop: Release 7.95.0 (#2122) Add toggling of NetP Notifications to iOS (#2112) Fix for deeplink crash when preparing webview preview (#2116) Integrates the latest DBP changes in BSK (#2108) Switch to next phase of new experiment for UA (#2118) Update BSK with autofill 9.0.0 (#2103) Add an “Open VPN Settings” quick action (#2089)
Task/Issue URL: https://app.asana.com/0/0/1205768725084797/f
BSK: duckduckgo/BrowserServicesKit#541
Description:
This adds the implementation of the VPN Notifications screen. It serves as a way to toggle NetP notifications on the iOS Network Extension and also to help prompt enabling notifications app-wide.
This is quite a design-heavy project, but there’s also use of an app-group shared UserDefaults store to share the toggle state between the status view, app side and the notifications presenter, extension side.
Steps to test this PR:
Copy Testing:
’
rather than’
Orientation Testing:
Device Testing:
OS Testing:
Theme Testing:
—
Internal references:
Software Engineering Expectations
Technical Design Template