-
Notifications
You must be signed in to change notification settings - Fork 106
ios: react to change in connectivity. #3428
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
base: master
Are you sure you want to change the base?
Conversation
9776180
to
6756b78
Compare
@benma This would be ready for review; however, while testing on the simulator, the banner seems to work fine when going offline, but not when going back online. I still don't have an iPhone to test on, so if you could test and report if it behaves fine on a real device it would be great! |
@benma I received my iPhone and tested on it. Ready for review for real :) |
@benma gentle ping :) |
@@ -464,7 +470,7 @@ | |||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; | |||
INFOPLIST_KEY_UILaunchScreen_Generation = YES; | |||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; | |||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait"; |
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.
These changes have been made by Xcode automatically, not sure the reason or whether they should be reverted or not
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.
git blame will tell you the reason for this line, it's deliberate :) should definitely revert
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.
well git blame won't tell me why XCode changed it, I meant :D reverted!
@@ -184,6 +185,10 @@ struct BitBoxAppApp: App { | |||
.edgesIgnoringSafeArea(.all) | |||
.onAppear { | |||
setupGoAPI(goAPI: goAPI) | |||
_ = NetworkMonitor.shared |
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.
Why not use that? isOnline = NetworkMonitor.shared.monitor.currentPath.status == .satisfied
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.
monitor
is private within NetworkMonitor so if we want to do this we need to make it non-private. I don't have a strong preference but I went for an alternative approach of adding an isOnline
method and calling that instead
@@ -464,7 +470,7 @@ | |||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; | |||
INFOPLIST_KEY_UILaunchScreen_Generation = YES; | |||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; | |||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait"; |
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.
git blame will tell you the reason for this line, it's deliberate :) should definitely revert
57c53fb
to
39c812d
Compare
Use NwPathMonitor to monitor change in connectivity, and trigger the offline banner when going offline, and a manual reconnection when going back online.
Use NwPathMonitor to monitor change in connectivity, and trigger the offline banner when going offline, and a manual reconnection when going back online.
Before asking for reviews, here is a check list of the most common things you might need to consider: