Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsegal/flutter_url_protocol
A unified Flutter library to register custom URL protocol handlers across all supported platforms.
https://github.com/lsegal/flutter_url_protocol
Last synced: about 2 months ago
JSON representation
A unified Flutter library to register custom URL protocol handlers across all supported platforms.
- Host: GitHub
- URL: https://github.com/lsegal/flutter_url_protocol
- Owner: lsegal
- License: mit
- Created: 2021-04-29T02:38:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-08T07:36:16.000Z (over 1 year ago)
- Last Synced: 2024-10-31T06:51:31.172Z (2 months ago)
- Language: C++
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 3
- Forks: 19
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `url_protocol`
A unified library to register custom URL protocol handlers across supported platforms.
## Compatibility
This library is designed for use within Flutter and primarily to serve on
Desktop platforms that require extra programmatic registration of URL handlers.In other words, this library is meant to provide protocol registration on the
Windows and Linux (coming soon) platforms.## Usage
Use the following to register or unregister a URL handler protocol.
```dart
import 'package:url_protocol/url_protocol.dart';void main() {
// Register a new custom URL protocol handler. Opening test-url-protocol://test
// will run the executable with the arguments: -url test-url-protocol://test
registerProtocolHandler('test-url-protocol', arguments: ['-url', '%s']);// Unregister and remove custom URL protocol handler
unregisterProtocolHandler('test-url-protocol');
}
```## Helpful Hints
Use this library with [multi_instance_handler](http://pub.dev/packages/multi_instance_handler)
to manage forwarding of the opened URL to the active instance of your application
on Desktop platforms.## TODO
- [ ] Instructions for Android, iOS, macOS
- [ ] Support for Linux## License & Author
This library was written by Loren Segal and is licensed under the terms of
the MIT license.