Nativescript: openURL(_:) is deprecated

Created on 2 Jul 2019  路  2Comments  路  Source: NativeScript/NativeScript

Is your feature request related to a problem? Please describe.
UIApplication#openURL(_:) is deprecated since iOS 10. It appears to be available still in iOS 12, but it will eventually need to be replaced and I could not find an issue for this.

This is used by tns-core-modules/utils's openUrl here.

Describe the solution you'd like
Switch to the Apple recommended UIApplication#open(_:options:completionHandler:)

Describe alternatives you've considered

  • Continue using openURL until it is not available in a new iOS SDK release.
  • Use open(_:options:completionHandler:) directly (not necessary yet / with current SDKs)

Additional context
I have not downloaded the headers for iOS 13 developer preview to see if openURL(_:) unavailable in the next version, but I assume it will be since Apple's own documentation still references it in UIApplication's overview.

Also, there are implications that may have to surface up to the tns-core-modules API since the deprecated openURL is synchronous, but the replacement is asynchronous.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

bug enhancement good first issue ios

Most helpful comment

Although this is not actually a bug (yet) I will mark it as one so we that the issue can be prioritized. Marking as a good-first-issue - anyone interested in contributing and implementing the newly introduced API is welcome.

All 2 comments

Although this is not actually a bug (yet) I will mark it as one so we that the issue can be prioritized. Marking as a good-first-issue - anyone interested in contributing and implementing the newly introduced API is welcome.

@NickIliev I'm willing to contribute here, but I'm not sure how to proceed regarding my comment on the API implications:

Also, there are implications that may have to surface up to the tns-core-modules API since the deprecated openURL is synchronous, but the replacement is asynchronous.

The current NS API passes on the success boolean for the call to openURL, however Android's call is still synchronous. Making the NS API asynchronous for either or (preferably) both Android & iOS would be a breaking change.

In the meantime I'll review the contributing document you link to. Thanks for the quick response!

Was this page helpful?
0 / 5 - 0 ratings