1

This just stopped working in XCode 7.2.1 building against 9.2.1.

I'm using Microsoft ADAL from cocoapods.

This is the error:

canOpenURL: failed for URL: "msauth://broker" - error: "(null)"

I've already added msauth to my Info.plist file under LSApplicationQueriesSchemes.

I think I am going to downgrade to XCode 7 to see if that works.

Edit: I added the LSApplicationQueriesSchemes item to the MS ADAL cocoapod and now it's returning data but still giving the same error.

Mevdev
  • 334
  • 2
  • 7
  • Are you sure that there is an app that is registered to handle that scheme? Is this a simulator or real device? – wottle Feb 29 '16 at 22:15
  • Both simulator and real device. Ostensibly my own app would accept this URL to validate a security feature. – Mevdev Feb 29 '16 at 22:30
  • But if you haven't built an app that handles it, you will get that error. – wottle Feb 29 '16 at 22:32
  • I don't get what you're saying. That I shouldn't respond to it? Should I take out teh LSApplicationQueriesSchemes? Have you had this problem? – Mevdev Feb 29 '16 at 23:03
  • No, but if you call `canOpenURL:` for a scheme like `msauth://broker`, you have to also have an app installed on the device / simulator that is built to handle that scheme like here: http://stackoverflow.com/a/12784399/3708242 You will need to build the other app that does something with the url "msauth://broker". In other words, if you call canOpenURL with something like "twitter://blah" but don't have twitter installed, you will see that error. – wottle Mar 01 '16 at 13:37
  • Thanks. It is for Microsoft ADAL so I suspect they just need to rewrite their library to make it compatible with 9.2.1 – Mevdev Mar 01 '16 at 17:44
  • Can you show the full log for the error? I wonder if the call is coming from the ADAL cocoapod library. Maybe you need to add it to the ADALiOSFramework Info.plist? – wottle Mar 01 '16 at 19:25
  • Wottle yes! I needed to do that for it to work. It works in OSes earlier than 9.2.1 just fine if I add the msauth to the plist of the ADAL cocoapod. I believe MS ADAL iOS library will need an update sooner than later. – Mevdev Mar 01 '16 at 20:43
  • So it's working now? If so, I'll post an answer so others that are having this problem will know the correct solution. I agree that the ADAL iOS CocoaPod will likely be updated soon to include this, if it still being maintained. – wottle Mar 01 '16 at 21:02

2 Answers2

0

It appears that for libraries within your iOS projects, the library's Info.plist needs to be updated to handle any custom URL schemes that the library may call canOpenUrl for. So if you have this issue, add the custom scheme to LSApplicationQueriesSchemes in the library's Info.plist, not the application's Info.plist.

wottle
  • 13,095
  • 4
  • 27
  • 68
0

On a real device it works, it's just weird output of the simulator.

Because it not able get some property settings on simulator.Please check on real device.

Bhanuteja
  • 71
  • 6