Skip to content

SPM support, Scene lifecycle (cold-start Universal Links lost), and a manual handleUrl() for in-app links#1

Description

@aovooyov

Hi @chelemen-razvan 馃憢

Ran into three gaps using grovs_flutter_plugin in production:

1. Swift Package Manager support

ios/grovs_flutter_plugin.podspec is CocoaPods-only, no Package.swift. Since
grovs-iOS itself already ships via SPM, adding
ios/grovs_flutter_plugin/Package.swift next to the podspec (Flutter auto-detects it, no
breaking change for CocoaPods users) would just be wiring:

// swift-tools-version: 5.9
import PackageDescription

let package = Package(
    name: "grovs_flutter_plugin",
    platforms: [.iOS("13.0")],
    products: [.library(name: "grovs-flutter-plugin", targets: ["grovs_flutter_plugin"])],
    dependencies: [.package(url: "https://github.com/grovs-io/grovs-iOS.git", "2.3.0"..<"2.4.0")],
    targets: [.target(name: "grovs_flutter_plugin", dependencies: [.product(name: "Grovs", package: "grovs-iOS")])]
)

2. Universal Links lost on cold start for Scene-based apps

GrovsPlugin only registers via registrar.addApplicationDelegate (legacy UIApplicationDelegate
plugin), never via registrar.addSceneDelegate (FlutterSceneLifeCycleDelegate). For apps using
UISceneDelegate (the current Flutter template default), Flutter's legacy-plugin shim drops
connectionOptions.userActivities when synthesizing didFinishLaunchingWithOptions from
scene:willConnectToSession:options: - so a *.sqd.link link tapped while the app is fully
closed never reaches application(_:continue:restorationHandler:), and is silently lost. Only
works today on warm resume.

Fix: conform GrovsPlugin to FlutterSceneLifeCycleDelegate and register via
registrar.addSceneDelegate(instance), forwarding scene(_:willConnectTo:options:) /
scene(_:openURLContexts:) / scene(_:continue:) to the existing Grovs.handleSceneDelegate(...)
calls. Removes the need for consuming apps to hand-write a SceneDelegate workaround.

3. No way to manually resolve a link tapped inside the app

Case: a Grovs short link rendered as a normal link inside the app's own UI (e.g. a chat message).
Tapping it should behave like a deep link, but both UIApplication.open(url, options: [.universalLinksOnly: true]) (iOS) and a plain ACTION_VIEW intent (Android) refuse to hand a
Universal Link/App Link back to the very app that's already requesting it - so it just falls
through to an in-app browser, and onDeeplinkReceived never fires.

The native SDKs already have the right entry points - Grovs.handleAppDelegate(open:options:)
on iOS, Grovs.onNewIntent(intent, activity) on Android (already used internally by
GrovsPlugin.kt's addOnNewIntentListener) - just not exposed via Dart. A Future<bool> handleUrl(String url) wired to those would cover it.

Maybe unrelated

ios/Resources/PrivacyInfo.xcprivacy doesn't look picked up by CocoaPods - s.source_files = 'Classes/**/*' doesn't cover Resources/, so it likely never ships via CocoaPods.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions