-
Notifications
You must be signed in to change notification settings - Fork 274
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
feat(apple): UI notification for reauth #3684
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Performance Test ResultsTCP
UDP
|
Terraform Cloud Plan Output
|
Performance Test Results: direct-perfTCP
UDP
|
In iOS:
|
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.
LGTM, just a couple questions regarding the macOS notification!
alert.messageText = "Your Firezone session has ended" | ||
alert.informativeText = "Please sign in again to reconnect" | ||
NSApp.activate(ignoringOtherApps: true) | ||
alert.runModal() |
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.
Is it possible to change the buttons on this alert to:
Dismiss | Sign in
so that the user can just click Sign in to fix it without having to click in the menubar?
Also, are the macOS notifications running in Notification center or are they separate? Do they auto-dismiss or stay visible until user action?
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.
Dismiss | Sign in
so that the user can just click Sign in to fix it without having to click in the menubar?
Makes sense, will do that. Update: It's possible to add buttons to the notification in iOS, so will do it in iOS as well.
Also, are the macOS notifications running in Notification center or are they separate? Do they auto-dismiss or stay visible until user action?
iOS-like notifications are available in macOS as well, they behave similar to iOS (by default they auto-disappear but the user can make them stay in OS Settings). However, they are easy to miss (because they are small and in a corner), so we're using an in-app alert instead.
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.
Gotcha. I'm wondering if it makes sense to use the Notification Center notification for macOS as well so that user's can turn it off if needed and so that it respects the Do Not Disturb settings by the user.
Otherwise it might be annoying to have that alert pop up in the middle of a presentation or something with no way to deactivate or see how much longer you have left in your session.
If they miss and notice the resources can't be accessed they'll probably figure out to click on the Firezone in menubar.
What do you think?
Performance Test Results: direct-tcp-client2server
|
Performance Test Results: relayed-tcp-server2client
|
Performance Test Results: direct-udp-server2client
|
Performance Test Results: relayed-udp-client2server
|
Performance Test Results: relayed-tcp-client2server
|
Performance Test Results: direct-tcp-server2client
|
Performance Test Results: direct-udp-client2server
|
Performance Test Results: relayed-udp-server2client
|
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.
Requesting changes as discussed in today's call
@roop Is this still a WIP or should I close it? |
The changes requested were:
The problem is that in macOS, for a user notification posted from the tunnel, the launching-the-app from the notification is not working correctly. The notification is shown, but on clicking on the notification, or on a button in the notification doesn't launch/activate the main app. (Found a relevant forum discussion on this too.) This works correctly in iOS. @jamilbk So ,shall we stick to using user notifications in macOS, without the 'Sign In' button in the notifications? Or should we go back to alerts? |
It's still a work-in-progress. |
Ah, I see, thanks for the clarification. Yeah, I thought we may run into issues with that. Let's keep the existing alert style on macOS in that case then and just have the 'Sign in' and 'Dismiss' options if that's still feasible. You'll need to rebase as I think there's been some CI changes since this was opened. |
2482897
to
e6f9892
Compare
- Add padding to info text - Add an image to increase visual differentiation between the VPN and notification screens
e6f9892
to
1b2ffa4
Compare
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.
LGTM, just some code organization / cleanup
swift/apple/FirezoneKit/Sources/FirezoneKit/Features/AskPermissionView.swift
Outdated
Show resolved
Hide resolved
Spacer() | ||
.frame(maxHeight: 20) | ||
Text( | ||
"After tapping on the above button, tap on 'Allow' when prompted." |
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.
"After tapping on the above button, tap on 'Allow' when prompted." | |
"After tapping the above button, tap 'Allow' when prompted." |
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.
Fixed in e83bbab
swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/AuthStore.swift
Outdated
Show resolved
Hide resolved
swift/apple/FirezoneNetworkExtension/PacketTunnelProvider.swift
Outdated
Show resolved
Hide resolved
As per review comments
I couldn't fit both iOS and macOS code into a single function because they need different inputs, because they get called from different places (iOS: from the tunnel, macOS: from the app). They also do different things (iOS: notification, macOS: alert). So, there are two different functions for iOS and macOS, and both are in
|
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.
This is much easier to understand, thanks!
This PR shows an alert (macOS) / local notification (iOS) when the user is signed out because of a tunnel error.
Fixes the apple part of #3329.