Flutter iOS Chromecast doesn't request for NSLocalNetworkUsageDescription - ios

I have a problem with a flutter app, whenever I call GCKCastContext.sharedInstance().presentCastDialog() the cast device popup shows, it says to check settings to make sure that Local Network Access is on, but there is no popup to request NSLocalNetworkUsageDescription permission from the user and never appears.
I am using 'google-cast-sdk', '~> 4.7.0'
I've already added com.apple.developer.networking.wifi-info to the Entitlements.
Also added the necesary fields into Info.plist
<key>NSBonjourServices</key>
<array>
<string>_googlecast._tcp</string>
<string>_CC1AD845._googlecast._tcp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>App uses the local network to discover Cast-enabled devices on your WiFi network.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>App uses Bluetooth to discover nearby Cast devices.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>App uses Bluetooth to discover nearby Cast devices.</string>
<key>NSMicrophoneUsageDescription</key>
<string>App uses microphone access to listen for ultrasonic tokens when pairing with nearby Cast devices.</string>
I am using CC1AD845 for NSBonjourServices because that's the Default Media Receiver Application ID.
It is a bit strange because the NSBluetoothAlwaysUsageDescription popup shows and that NSLocalNetworkUsageDescription doesn't show in settings and at all in the app.
Does anyone have any tips what I should do next in order for the NSLocalNetworkUsageDescription request dialog to appear?

Related

I am getting this error when trying to upload the app to testflight "ITMS-90683: Missing Purpose String in Info.plist"

I have added the following code in the Info.plist
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAppleMusicUsageDescription</key>
<string>Play using while you are hiking</string>
<key>NSCameraUsageDescription</key>
<string>Please Allow the app to access the device camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>Please Allow the app to access the device microphone</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Privacy - Please Allow the app to handle your photos</string>
</dict>
I am creating the archive in Xcode and re distributing and still getting the error Missing Purpose String in Info.plist"
As on Apple documentation for NSAllowsArbitraryLoads
Important
You must supply a justification during App Store review if you set the key’s value to YES, as described in Provide Justification for Exceptions. Use this key with caution because it significantly reduces the security of your app. In most cases, it’s better to upgrade your servers to meet the requirements imposed by ATS, or at least to use a narrower exception.

Allow opening my app from a link in a third-party app

I'm currently using a custom URL scheme to allow users to access my app (say, FoobarApp) from custom links (foobar://resource/42).
I set up the scheme like so :
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.acme.foobarapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>foobar</string>
</array>
</dict>
</array>
This works well when the users click the link in Safari.
Now I'd like them to be able to click said links in third-party apps (in my case Trello), to open my app.
This does not work, as the system (since iOS 9 if I'm not mistaken) now requires that apps whitelist URL scheme they want to query (with the LSApplicationQueriesSchemes in Info.plist).
(This is the message I get in the logs when I click the link in the third-party app:
iPad Trello(UIKit)[2368] : -canOpenURL: failed for URL: "foobar://resource/42" - error: "This app is not allowed to query for scheme foobar"
)
It's not reasonable to expect the third-party app to add my (enterprise) app's scheme to their LSApplicationQueriesSchemes list. Is their any option to "bypass" this protection? A kind of way to tell the system "It's fine, Trello can open my app"?
Summary
Custom app links foobar:// work in Safari
They don't work in third-party app (nothing happens, see log a few lines up)
How can I whitelist third-party apps so they can open my app?
an app has to tell ios it wants to query a url scheme. It has to declare this in its info plist at compile time!
There is no way around this on a apple allowed iPhone.
Sure when you jailbreak a phone, all can be done but... thats not a valid assumption either ;)
a workaround may be to link to a Website via HTTP and have the user open the app from there.

Does my Mac App need to apply Server Entitlement Key?

My mac app has a built-in AirPlay function for streaming video file from my app to Apple TV, so do I need a Server Access entitlement key ("com.apple.security.network.server") when submitting it to Mac App Store?
https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW9
Yes ! your need that Entitlement Key
If your app connects to the internet, you need to add the following lines to your entitlements.plist:
<key>com.apple.security.network.client</key>
<true/>

How to deal with this error AVAudioSessionErrorCodeMissingEntitlement?

I'm trying to integrate with iOS10's CallKit, however when I'm trying to initialize the audio session after accept a phone call, this "AudioUnitInitialize" API will throw out this error "AVAudioSessionErrorCodeMissingEntitlement".
According to the document, it's just one line explanation:
https://developer.apple.com/reference/avfoundation/avaudiosessionerrorcode/avaudiosessionerrorcodemissingentitlement
How should I update the entitlement for support this? Does any body has any experience?
I also ran into this issue in iOS10 Beta 6, and was able to resolve it by moving the "AudioUnitInitialize" API from the performAnswerCallAction: method (as implemented in SpeakerBox) to the init routine of the ProviderDelegate.
By moving initialization earlier in the lifecycle of the ProviderDelegate, somehow the 'entitlement' problem is avoided.
I've downloaded Apple's Speakerbox sample app to examine the entitlements and background modes used for CallKit.
It looks like they add the Background Modes -> voice over IP entitlement and the "App provides Voice over IP services" key to the app's Info.plist:
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
</array>
It also adds the INStartAudioCallIntent key to NSUserActivityTypes and the following Microphone Usage Description:
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) uses the Microphone for call audio</string>
<key>NSCallKitUsageDescription</key>
<string>$(PRODUCT_NAME) makes and receives calls</string>
<key>NSUserActivityTypes</key>
<array>
<string>INStartAudioCallIntent</string>
</array>

How to toggle torch functionality in iPhone 4 iOS 6 at app start with preferences plist

I'm using an app called "Stickam", which is live audio/video recording and upload over 3G. The app is perfect for my purpose except for lacking LED torch (flashlight) mode. I have a tweak installed which allows me to toggle on torch via settings and leave it on while I use other apps (i.e., Safari, Appstore) but when I start a Stickam broadcast, the torch turns off.
I'm using a file browser on the iPhone with basic text editing and file manipulation ability to examine the iOS file structure and the apps. I don't want to edit Stickam, just override it's setting by pasting in Stickam's
var/mobile/Applications/FA037A73-C483-43D6-8AE8-7E69CD57EBDD/Library/Preferences/.GlobalPreferences.plist, a reference to torch's location and trigger.
Similar to:
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>alternateColors</key>
<true/>
<key>defaults</key>
<string>com.ravirajm.torch</string>
<key>key</key>
<string>torchenabled</string>
<key>label</key>
<string>Enable Torch</string>
<key>PostNotification</key>
<string>com.ravirajm.torch/prefs</string>
</dict>
Doesn't seem like it would work. What ideas do you have on how to do this?
You can't modify another developer's app bundle at all unless the device is jailbroken.

Resources