fix(ios): stop the unhandled-URL log mis-attributing deep-link breakage + add scene-delegate support (#2422)#2429
Conversation
…reakage (flutter-stripe#2422) The debug log fired for every non-Stripe URL and read as if Stripe consumed it, which is what flutter-stripe#2422 was actually about. It now only warns for the app's own configured urlScheme and states plainly that flutter_stripe returns false and does not block other URL handlers/plugins. Adds a deep-linking coexistence section to the README and handleURLCallback docs.
…r UISceneDelegate (flutter-stripe#2422) flutter_stripe was app-delegate-only, so under a UISceneDelegate app its openURL handling was only reached via the engine's app-delegate fallback, which a custom scene delegate can bypass and break Stripe redirect payments. Conform StripePlugin to FlutterSceneLifeCycleDelegate and addSceneDelegate. These APIs need Flutter >= 3.38, so the min Flutter is bumped from 3.0.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR registers StripePlugin as an iOS UISceneDelegate to receive redirect callbacks, narrows debug logging for unhandled URLs, adds documentation on coexistence with other deep-link plugins, and raises the minimum Flutter SDK to >=3.38.0. ChangesDeep-Linking & Scene Delegate Coexistence
sequenceDiagram
participant AppRouter
participant UIScene
participant StripeSceneDelegate
participant StripeAPI
AppRouter->>UIScene: Receive deep link (custom handler)
UIScene->>StripeSceneDelegate: scene(_:openURLContexts:) / continueUserActivity
StripeSceneDelegate->>StripeAPI: handleURLCallback(url)
alt handled by Stripe
StripeAPI-->>StripeSceneDelegate: true
else not handled by Stripe
StripeAPI-->>StripeSceneDelegate: false
StripeSceneDelegate-->>AppRouter: allow other handlers to run
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…so iOS compiles (flutter-stripe#2422) FlutterSceneLifeCycleDelegate imports scene:continueUserActivity: under the Swift name scene(_:continue:) (UIKit renames the selector). Implement the witness under exactly that name — matching how app_links does it — instead of a custom name + explicit selector, which the compiler rejected as a conflicting requirement.
9baa7cd to
e31b406
Compare
Fixes #2422 (same confusion as #2137/#2158).
The debug log I added in #2290 backfired — it prints for every non-Stripe URL and reads like flutter_stripe ate the deep link, so people assume we're blocking app_links. We're not: we return
falseand the delegate chain keeps going. First commit makes the log only warn for your own StripeurlSchemeand say plainly we don't block other handlers, and adds a README section on coexisting with app_links/go_router.Second commit is related: we were app-delegate-only, so on UISceneDelegate apps our redirect handling was only reached via the engine's app-delegate fallback, which a custom scene delegate can skip. Now we also register as a
FlutterSceneLifeCycleDelegate. Those APIs need Flutter 3.38+, so I bumped the min Flutter — fine to drop that second commit or guard it differently if you'd rather not raise the floor.I couldn't reproduce the reporter's app_links case without their setup. The log/doc change is behavior-preserving; the new scene handlers still return
falsefor non-Stripe URLs, so other plugins are unaffected.Summary by CodeRabbit
Breaking Changes
Bug Fixes / Improvements
Documentation