I have flutter app and deeplinks works fine when I click on button from gmail for Android app but not for iOS.
the URL in the email templates comes from courier, courier generates the cta URLs itself and then it is added to a button in a template via <a href https://718d95b0-XXXX-test.ct0.app> Here is what I have so far:
apple-app-site-association
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TeamId.BundleId",
"paths": ["*", "/"]
}
]
}
}
Info.plist
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>DomainName</string>
</array>
</dict>
</array>
<key>FlutterDeepLinkingEnabled</key>
<true/>
in iOS AppDelegate.swift
import UIKit
import Flutter
import courier_flutter
@UIApplicationMain
@objc class AppDelegate: CourierFlutterDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func application(
_ application: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// Handle the incoming URL and pass it to the Flutter engine
if let controller = window?.rootViewController as? FlutterViewController {
let channel = FlutterMethodChannel(name: "BundleId/deeplink", binaryMessenger: controller.binaryMessenger)
channel.invokeMethod("onDeepLinkReceived", arguments: url.absoluteString)
}
return true
}
}
in flutter routes.dart
GoRoute(
name: NamedRoute.home,
path: '/',
redirect: (context, state) => state.locationWithQuery(
'/dashboard',
),
),
Runner.entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:domain</string>
</array>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>