DonutWare / Fladder

Fladder - A Simple Jellyfin frontend built on top of Flutter.
https://donutware.github.io/Fladder/
GNU General Public License v3.0
315 stars 15 forks source link

๐Ÿ› [iOS] server autodiscovery not working, because permission for local network scanning is not requested probably #26

Open p0358 opened 1 month ago

p0358 commented 1 month ago

Description

On iOS being able to access any LAN addresses requires explicitly asking the user with a dialog. Currently the app keeps on spinning there and it's never gonna detect anything.

Reproduction steps

1. Open up the app
2. See it tries to detect servers, but it's never gonna work

My suggestion is that auto-discovery should occur there after some kind of button press, and only then to open that dialog. Users don't really like it UX-wise when the first thing a new app asks upon opening is to scan their LAN without explanation (and some anti-user apps that don't need this do so to spy on people, like Facebook etc, so it'd have bad connotations if not explicit).

Screenshots

No response

Logs

No response

Platform

iOS

App Version

v0.2.5-alpha

p0358 commented 1 month ago

so fun fact: I was actually fiddling with making a jailbreak tweak for a random iOS app that doesn't have com.apple.security.network.client in its entitlements and apparently the app asked for local network access permission automatically when I tried to send a UDP packet to local IP after creating a DGRAM socket, very interesting

but if this meant to be done automatically, then either some entitlement that in general permits it might be missing or the app actually for some reason maybe doesn't actually even try to create such socket?

PartyDonut commented 1 week ago

Hey, just happened to run the app inside of a simulator but on that the server discovery seems to be working just fine, that makes a bit difficult to test in my case.

Not sure but I'm expecting Simulators te be even more locked down then a real device?

Something else that might be causing an issue is this? But I would still expect the simulator to throw the same error. https://docs.flutter.dev/release/breaking-changes/network-policy-ios-android

If you have the option to debug it on a real device that would be great๐Ÿ‘๐Ÿผ

p0358 commented 1 week ago

Hmm, not sure, it's not impossible something might be filtered out in my network instead. Do you know if other clients have similar autodiscovery to test it out for comparison? As iirc most didn't have that form my memory.

Not sure but I'm expecting Simulators te be even more locked down then a real device?

That's probably not a good idea of them generally, I know stuff like simject exists to test out jailbreak tweak injection into apps there, while on a real device you need a proper jailbreak which is much harder to achieve due to hardware security features. But I'm not familiar with the specifics of iOS simulator and intricacies like this so can't really tell

PartyDonut commented 1 week ago

Hmm, not sure, it's not impossible something might be filtered out in my network instead. Do you know if other clients have similar autodiscovery to test it out for comparison? As iirc most didn't have that form my memory.

Not sure Swiftfin will probably have it considering it's a official? jellyfin client. They also advice iOS users to check these settings as well.

Just to check on iOS, go to to the Settings app -> Swiftfin and make sure Local Network is enabled

One thing I can try is this though https://developer.apple.com/forums/thread/663768 the work-around most people use is just pinging a random device on the network which causes the pop-up to appear.

So best action for iOS would be this I think?

  1. Show a button the user has to press to "start" scanning.
  2. This then tries to ping a local device. Causing the local network security pop-up to occur
  3. Success??