Hillpro / upnp_client

Universal Plug and Play Client (UPnP) Implementation. Supports IGD control as well as DLNA
MIT License
8 stars 3 forks source link

UPnP search works in the iOS simulator, but it doesn't work on a real iPhone #5

Open oldstone88 opened 1 week ago

oldstone88 commented 1 week ago

Is there an existing issue that is already proposing this?

Is your feature request related to a problem? Please describe it

UPnP search works in the iOS simulator, but it doesn't work on a real iPhone. I tried to enable all permissions, but it still didn't help. My info.Plist `<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName Mimiplayer CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName mimiplayer CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS UIApplicationSupportsIndirectInputEvents UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UISupportedInterfaceOrientations UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown LSMinimumSystemVersion 14.0 NSAppleMusicUsageDescription We use access to the library to play files. NSMicrophoneUsageDescription We use the microphone to record sound. NSPhotoLibraryUsageDescription We use access to the photo library to save recordings. NSLocalNetworkUsageDescription This app uses the local network to search for UPnP devices. NSCalendarsUsageDescription We use access to your calendar to plan events and reminders. NSContactsUsageDescription We use access to your contacts to improve social features. NSMotionUsageDescription We use motion data to improve the app's functionality. NSSpeechRecognitionUsageDescription We use speech recognition to enable voice commands. NSSiriUsageDescription We use Siri to provide voice-activated features. NSLocationAlwaysAndWhenInUseUsageDescription We use your location to provide location-based services. NSLocationWhenInUseUsageDescription We use your location to provide location-based services while using the app. NSBluetoothAlwaysUsageDescription We use Bluetooth to connect to nearby devices. NSBonjourServices _upnp._tcp NSAppTransportSecurity NSAllowsArbitraryLoads

`

Describe the solution you'd like

A real iPhone will search for UPnP devices.

Teachability, documentation, adoption, migration strategy

It is desirable to have a full example of settings for iOS (Info.plist, Podfile) and Android (AndroidManifest.xml).

What is the motivation / use case for changing the behavior?

Faster and more understandable work with the plugin

Hillpro commented 1 week ago

Hello Sergey,

Thanks for filling this issue. This package is mostly tested on Android and Windows devices, so I am currently not aware of that bug for iPhone. I knew that recent version of iOS was restricting access to multicast sockets, but I didn't research further.

I am gonna look for a potential fix in Apple documentation and will certaily update the package documentation with necessary entries in the Info.plist file.

Could you please provide me with the iPhone and iOS version this bug is currently affecting.

Hillpro commented 1 week ago

From what I have find so far, iOS 14+ applications need the com.apple.developer.networking.multicast entitlement to send or receive IP multicast traffic.

Here are some articles: https://stackoverflow.com/questions/78127374/send-udp-socket-multicast-address-in-network-framework-ios-17-version https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_networking_multicast

Could you try those and tell me if this is working in your case ?