feat: tvOS support for url_launcher - #23
Open
TheNoumanDev wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
url_launcher_tvos, the federated tvOS implementation ofurl_launcher, ported fromurl_launcher_ios6.4.1.canLaunchUrland externallaunchUrlwork on tvOS viaUIApplication.canOpenURL/open(_:options:); the in-app browser modes rely onSFSafariViewController(SafariServices), which does not exist on tvOS, so those are reported unsupported rather than crashing.Closes #16.
Package(s) touched:
url_launcher_tvos(new) + root README ports table.How was it tested?
Ran the package's
example/appVerified on tvOS simulator (version: 26.2)
Verified on a physical Apple TV (Apple TV 4K 3rd gen / tvOS 26.6)
dart analyzeis clean for the packageAll four Pigeon channels round-trip on the simulator with no
MissingPluginException.Real external launch confirmed two ways: on the simulator a registered app URL scheme launched a separate app (its
AppDelegatelogged the delivered URL); on a physical Apple TV 4K,launchUrlopened the App Store.In-app browser modes throw
PlatformException(no_ui_available);supportsModereturnsfalsefor them.Versioning & changelog
version:set to0.0.1(new package)## 0.0.1entry at the top ofCHANGELOG.md0.x: initial0.0.1Checklist
url_launcher_tvosfiles touched (+ the root README ports row, required by the R1 gate)TODO/debug leftoversREADME.mddocuments the tvOS constraint (no in-app browser / no WebKit)Notes for reviewers
messages.g.dartis byte-identical to 6.4.1;messages.g.swiftdiffers only by the import gate (#if os(iOS) || os(tvOS)). The porter had wrappedUrlLauncherApiSetup.setUpin#if !os(tvOS)(it matchedSFSafariViewControllerin a doc comment) — that would have unregistered every channel on tvOS; reverted.URLLaunchSession(SafariServices) is#if !os(tvOS);openUrlInSafariViewControllerreturns.noUIandcloseSafariViewControlleris a no-op on tvOS.canLaunchUrl/launchUrlare untouched, andLauncher.swift/ViewPresenter.swiftare byte-identical to upstream.supportsMode/supportsCloseForMode/platformDefault(this Dart runs only on tvOS, so no platform guards).tvos/Package.swift(SPM), matching the pure-Swift method-channel plugins from feat(spm): add Package.swift to the Swift method-channel plugins #1.flutter: >=3.13.0— upstream 6.4.1 raised its floor to Flutter 3.38 / Dart 3.10 (in 6.4.0), but nothing in this tvOS slice needs it (it builds anddart analyzes clean on the lower floor), and it stays consistent with the sibling_tvospackages.canLaunchUrlcan returntruefor a web URL even when nothing handles it, so callers should rely on thelaunchUrlreturn value (documented in the README). This PR also removesurl_launcherfrom the README's "Evaluated but not provided" table, since it is now provided.