deep_links 0.1.0 deep_links: ^0.1.0 copied to clipboard
A new flutter plugin project.
DeepLinks plugin for macOS #
Installation #
pubspec.yaml
...
dependencies:
deep_links_macos: ^0.1.0
...
This step won't be necessary when flutter#41471 will be resolved
AppDelegate.swift
+ func application(_ application:NSApplication, open urls: [URL]) {
+ var data: [String: URL] = [:]
+ data["link"] = urls[0]
+
+ NotificationCenter.default.post(Notification(name: Notification.Name(rawValue: "linkReceived"), object: nil, userInfo: data));
+ }
+
Usage #
import 'package:deep_links/deep_links.dart';
final dl = new DeepLinks();
dl.onLinkReceived.listen((link) {
print(link);
});