deep_links 0.3.0+4 copy "deep_links: ^0.3.0+4" to clipboard
deep_links: ^0.3.0+4 copied to clipboard

PlatformmacOS

A new flutter plugin project.

DeepLinks plugin for macOS #

GitHub stars Twitter Follow

Installation #

pubspec.yaml

...
dependencies:
  deep_links: ^0.3.0
...

This step won't be necessary when flutter#41471 will be resolved

Add this to your AppDelegate.swift

  override 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));
  }

Define your scheme (Info.plist)

	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>your_url_scheme</string>
			</array>
		</dict>
	</array>

Now you can open your_url_scheme://somethingsomething types of urls and these would be sent to your macOS app

👇 Here's how you can handle those in dart

Usage #

import 'package:deep_links/deep_links.dart';

DeepLinks.instance.onLinkReceived.listen((link) {
  print(link);
});
0
likes
130
pub points
48%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on deep_links