Skip to content
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(mobile): Adds WiFi only backup option to iOS #6724

Merged
merged 2 commits into from Feb 8, 2024

Conversation

martyfuhry
Copy link
Contributor

I've added the "Only on Wifi" backup option to iOS by using the NwPathMonitor and querying for

let wifiMonitor = NWPathMonitor(requiredInterfaceType: .wifi)
let isExpensive = wifiMonitor.currentPath.isExpensive

I did not do any end-to-end testing, but I've tested this:

image
image

Which is correctly reporting that I am on Wi-Fi and the connection is not expensive. Someone who typically uses an iPhone to debug could roll this change up and test it on their device! Or else I could play with some of the "Schedule background fetch" options in XCode. Testing these backups will always be a pain...

Copy link

cloudflare-pages bot commented Jan 30, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: aca52c2
Status: ✅  Deploy successful!
Preview URL: https://dbeb86b9.immich.pages.dev
Branch Preview URL: https://feat-wifi-is-too-expensive.immich.pages.dev

View logs

@alextran1502
Copy link
Contributor

I just finished the end-to-end test, and assets are still uploaded using cellular while the setting is on

@martyfuhry
Copy link
Contributor Author

martyfuhry commented Jan 30, 2024

I just finished the end-to-end test, and assets are still uploaded using cellular while the setting is on

Hmm, dang. isExpensive indicates that it should work:

A Boolean indicating whether the path uses an interface that is considered expensive, such as Cellular or a Personal Hotspot.

So either my logic is wrong or else that boolean isn't returning correctly on cellular. I don't normally develop on an iPhone that has cellular, but I can grab one. I'd like to see the output of isExpensive when the device is clearly on Cellular and not Wi-Fi.

@alextran1502 alextran1502 merged commit 0d876a4 into main Feb 8, 2024
24 checks passed
@alextran1502 alextran1502 deleted the feat/wifi-is-too-expensive branch February 8, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants