Skip to content

Commit

Permalink
handle deeplinks on ios native side
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmohsin7 committed Nov 21, 2024
1 parent 736ba5f commit 440c93f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIKit
import Flutter
import UserNotifications
import app_links

@main
@objc class AppDelegate: FlutterAppDelegate {
Expand All @@ -14,6 +15,13 @@ import UserNotifications
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)

// Retrieve the link from parameters
if let url = AppLinks.shared.getLink(launchOptions: launchOptions) {
// We have a link, propagate it to your Flutter app or not
AppLinks.shared.handleLink(url: url)
return true // Returning true will stop the propagation to other packages
}
//Creates a method channel to handle notifications on kill
let controller = window?.rootViewController as? FlutterViewController
methodChannel = FlutterMethodChannel(name: "com.friend.ios/notifyOnKill", binaryMessenger: controller!.binaryMessenger)
Expand Down

0 comments on commit 440c93f

Please sign in to comment.