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

iOS 14 Unexpected Behavior #56

Closed
olympianoiseco opened this issue Sep 17, 2020 · 26 comments
Closed

iOS 14 Unexpected Behavior #56

olympianoiseco opened this issue Sep 17, 2020 · 26 comments

Comments

@olympianoiseco
Copy link
Collaborator

olympianoiseco commented Sep 17, 2020

I am testing on iOS14 and am getting some unexpected behavior with Link, where it fails to connect to peers on the local network.

Update : I've been able to reproduce the issue with LinkHut.

To test:
Open Ableton on my computer (10.1.17, macOS 10.15.6) and enable Link.
Open my app on iPad (iOS 13.2, latest LinkKit version) and enable Link,
Open my app on iPhone (iOS 14, latest LinkKit version) and enable Link. The system requests permissions for local network usage, and I accept)

Expected result :
Link works on all three devices.

Actual Result:
Link works between Ableton and the iPad (iOS 13). The iPhone (on iOS14) does not find the other link enabled apps.

This is possibly related to the restrictions on local network access with iOS14. On iOS14, local network access must be confirmed by the user. As expected, this dialog pops-up when enabling Link for the first time. However, granting access does not fix the issue. In addition, if you deny access, the Link View Controller will show the enabled state regardless of permissions.

Additional breadcrumbs :
The App Store build of my app (built with a previous iOS SDK, and older LinkKit) works as expected.

If I open up another one of my Link enabled apps on my device, my app is able to connect to all of the Links in the network. As soon as I quit the other Link app on the device, it disconnects.

I'm able to re-create the issue using the LinkHut demo project. LinkHut will not connect to other Link enabled apps in the network unless the older Link enabled app is also open. LinkHut works correctly on my iPad with iOS13.

Any thoughts or things to try would be greatly appreciated.

Thanks,
Ben

@fgo-ableton
Copy link
Contributor

Hey Ben,

Thanks for reporting this. Here is what I tried to reproduce this:

  • Run Live with Link enabled on my computer. (macOS 10.15.6)
  • Run Patterning with Link enabled on an iOS 13 device
  • Run LinkHut (from LinkKit 3.1.3) built with Xcode 12.0 (12A7209) on my phone with iOS 14.

When giving permission to access the local network, all three devices find each other and everything works as expected.

I have no idea what is causing the issue for you. Have you tried to completely uninstall the app that is not working? Maybe the OS remembers that the app does not have networking permissions for some reason, and just reinstalling via Xcode does not reset that.
That's unfortunately the only I can think of at the moment.

Best, Florian

@olympianoiseco
Copy link
Collaborator Author

Thanks Florian,
I've tried a couple of other things (updating Xcode, restarting the device, re-installing the app) and am still running into the issue. I will report back when I figure out what's going on. Hope you are well!
Ben

@fgo-ableton
Copy link
Contributor

This is weird! Let me know if there is something I should test.

@uwehollatz
Copy link
Collaborator

I am running into exact same problem as @olympianoiseco describes when preparing my app for an iOS14 update. I am a bit lost on how to fix this.

@fgo-ableton : The problem is reproducible with LinkHut by setting the deployment target to any value greater than iOS 11.4, so there is a strong relationship to the issue #57

@frogg
Copy link

frogg commented Oct 11, 2020

@fgo-ableton : The problem is reproducible with LinkHut by setting the deployment target to any value greater than iOS 11.4, so there is a strong relationship to the issue #57

I'd even go as far and say both #56 and #57 have the same root cause and could be fixed by the same fix. We need to know which networking privacy rules(?) changed with iOS 11.4 then.

@fgo-ableton
Copy link
Contributor

Ok. I can reproduce this now.
Link does not use Bonjour. It uses multicast UDP messages on port 20808.
I found https://developer.apple.com/forums/thread/662082 and https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_networking_multicast
It seems there are indeed new requirements in iOS 14. And as @uwehollatz pointed out, when compiling against the iOS 11.4 SDK, Link still work fine - even when running on iOS 14.

@frogg
Copy link

frogg commented Oct 12, 2020

Ok. I can reproduce this now.
Link does not use Bonjour. It uses multicast UDP messages on port 20808.
I found https://developer.apple.com/forums/thread/662082 and https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_networking_multicast
It seems there are indeed new requirements in iOS 14. And as @uwehollatz pointed out, when compiling against the iOS 11.4 SDK, Link still work fine - even when running on iOS 14.

Oh wow, that sounds like you need to request a special entitlement from Apple in order to make LinkKit work then?

This entitlement requires permission from Apple before you can use it in your app. Request permission from the Multicast Networking Entitlement Request page.

@designerfuzzi
Copy link
Collaborator

designerfuzzi commented Oct 12, 2020 via email

@uwehollatz
Copy link
Collaborator

I cannot set the target of my app to anything below iOS13 since I am relying on this version. So basically every app which uses Ableton Link on iOS and needs the target set to iOS12 and higher will stop working ... ok, I have filled out the form to request the multicast network entitlement form Apple. I will let you know about my outcomes then.

@uwehollatz
Copy link
Collaborator

No special requirements from Apple needed, just User Consent to agree that the local network is used from the App that asks for consent -

no sorry @designerfuzzi, only the consent is not working.

@Reinissance
Copy link
Collaborator

Can confirm: the nslocalnetworkusagedescription is needed, as well as a bonjourservice entry: at least my app using audiobus needed it for this to work, but for link I didn’t put no entry to this array and it works as expected for me. Could be it’s needed there because before I made it for audiobus the user wasn’t asked for permission to grant the usage?

@uwehollatz
Copy link
Collaborator

OK - here is my update:
I have requested the com.apple.developer.networking.multicast entitlement for my app at Apple yesterday. Today morning I got approval, Apple is fast :)
Then I was following the steps (New Process) as described here https://developer.apple.com/forums/thread/663271
And ... Its working now!
So I can confirm: When you target iOS12 and up, you have to include NSLocalNetworkUsageDescription in your Info.plist and you need to request the Multicast Network Entitlement for your AppID and apply it to your app as described.

@fgo-ableton
Copy link
Contributor

Just adding NSLocalNetworkUsageDescription and a Bonjour entry for the app does not seem to work. Which is in accordance with what Apple sais.
This unfortunately means all apps with Link support will have to request the entitlement. Also one is not able to test with the LinkHut example app on a device anymore. 😞

@fgo-ableton
Copy link
Contributor

Can confirm: the nslocalnetworkusagedescription is needed, as well as a bonjourservice entry: at least my app using audiobus needed it for this to work, but for link I didn’t put no entry to this array and it works as expected for me. Could be it’s needed there because before I made it for audiobus the user wasn’t asked for permission to grant the usage?

Maybe this works because Audiobus is actually using Bonjour, and that also enables other network traffic?

@Reinissance
Copy link
Collaborator

That’s my guess. The app also uses osc protocol so there is an entry for it on the bonjour service too, so these two seem to open the network connectivity.

@designerfuzzi
Copy link
Collaborator

designerfuzzi commented Oct 13, 2020 via email

@uwehollatz
Copy link
Collaborator

uwehollatz commented Oct 15, 2020

Another thing is, would it work when you implement the old Link bundle in an App that has deployment target set to iOS14?

No. Once you target iOS12 and up and run on iOS14 you will need the entitlement.

@fgo-ableton
Copy link
Contributor

Another thing is, would it work when you implement the old Link bundle in an App that has deployment target set to iOS14?

No. Once you target iOS12 and up and run on iOS14 you will need the entitlement.

Using Xcode 11 and targeting iOS 13 might also allow running on iOS 14. But I don't have the devices here to verify that.

@olympianoiseco
Copy link
Collaborator Author

@fgo-ableton
I requested the entitlement from Apple and got this response, which I don't know how to respond to :

Thank you for your interest in Multicast Networking. Can you please provide more details on which multicast or broadcast protocol (IP address and port) you need to use? What messages are exchanged between devices?

@uwehollatz, what did you tell them to get approved?

@uwehollatz
Copy link
Collaborator

This is what I have filled into the form to get approval:

Describe your app:

  • A classic Metronome with the feature to sync-up with other Metronomes or Ableton Link enabled devices.

Explain why your app needs to send multicast or broadcast traffic, or browse for all Bonjour service types

@olympianoiseco
Copy link
Collaborator Author

Thanks @uwehollatz. That's more or less what I said in my application, but I didn't include a link to the website. Hopefully adding the link to the Ableton Link website will be enough to get it through.

@fgo-ableton
Copy link
Contributor

@olympianoiseco The IP and port Link uses are 224.76.78.75:20808. I'll add some documentation once we have successfully gone through the entitlement process.

@fgo-ableton
Copy link
Contributor

Our request for the entitlement has been approved. We also referenced https://www.ableton.com/en/link/
I added some information about iOS 14 compatibility to the documentation.

@fgo-ableton
Copy link
Contributor

@olympianoiseco Are there any news on the entitlement process from your side?

@frogg
Copy link

frogg commented Oct 30, 2020

@olympianoiseco Are there any news on the entitlement process from your side?

I requested an entitlement in a similar manner, and mine just got approved this morning.

@olympianoiseco
Copy link
Collaborator Author

Mine just came through last night as well! Had to bug them, but it's all good now. Haven't implemented the entitlement yet but I don't expect that to be an issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants