LSSupportsOpeningDocumentsInPlace

Dear Team,

We have the following crash obtained through crashlytics.*

Application has LSSupportsOpeningDocumentsInPlace key, but doesn't implement application:openURL:options: on delegate <*.AppDelegate: 0x28144df10>
  • As of iOS 12 onwards application supporting Open URL needs to add 'LSSupportsOpeningDocumentsInPlace' in their info.plist and the same has been added in the my code base, but still why get this error.

  • But as of iOS 14 even though we follow the compliance we are seeing this being reported as crash.

  • There are no similar case from any developer being reported in apple developer portal / open forum.

Kindly let us know what can be done.
Answered by PrithiviApple in 664081022
Hi Edford,

Thanks for your reply, much appreciated.

But we have implemented this method 2 years back then why we are getting crash suddenly on iOS 14.

private func application(: UIApplication, open url: URL, options : [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { }

Any reasons behind the same ?
Your app delegate needs to implement UIApplicationDelegate application:openURL:options:.
Accepted Answer
Hi Edford,

Thanks for your reply, much appreciated.

But we have implemented this method 2 years back then why we are getting crash suddenly on iOS 14.

private func application(: UIApplication, open url: URL, options : [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { }

Any reasons behind the same ?
Test using a brand new focused sample that implements that openURL method with the LSSupportsOpeningDocumentsInPlace key set appropriately, and determine this is working, and slowly scale up the sample to match your real app to identify where the issue is hiding. The scenarios I'm aware of where this doesn't work are all exactly as the error describes, where one of the 2 API requirements is not implemented.
Thanks Edford, Much appreciate your constant reply.

As you advised I will change and see how it goes in the next prod release and keep you posted.

Please find the existing and change of snippets for your reference.

EXISTING
private func application(: UIApplication, open url: URL, options : [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool

{NEW/CHANGED
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
Ah ha! I didn't notice that private keyword. Delegate methods cannot be private, since the purpose of delegation is to provide an API set for communication across objects. This is why the system can't see that you're implementing the delegate method required.

Awesome

Thank you edford, much appreciated.

Yes as you said the code was bit older and I felt the private might be an issue, you finally confirmed.

We are good to close this ticket as resolved. :)
LSSupportsOpeningDocumentsInPlace
 
 
Q