Skip to content

Commit 6849cf8

Browse files
committed
chore: Add msix configuration to README.md
1 parent 943d946 commit 6849cf8

File tree

2 files changed

+53
-44
lines changed

2 files changed

+53
-44
lines changed

README-ZH.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# protocol_handler
22

3-
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] ![][visits-count-image]
3+
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] ![][visits-count-image]
44

55
[pub-image]: https://img.shields.io/pub/v/protocol_handler.svg
66
[pub-url]: https://pub.dev/packages/protocol_handler
7-
87
[discord-image]: https://img.shields.io/discord/884679008049037342.svg
98
[discord-url]: https://discord.gg/zPa6EZ2jqb
10-
119
[visits-count-image]: https://img.shields.io/badge/dynamic/json?label=Visits%20Count&query=value&url=https://api.countapi.xyz/hit/leanflutter.protocol_handler/visits
1210

1311
这个插件允许 Flutter 应用注册及处理自定义协议(即深度链接)。
@@ -21,27 +19,26 @@
2119
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2220
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2321

24-
- [protocol\_handler](#protocol_handler)
25-
- [平台支持](#平台支持)
26-
- [截图](#截图)
27-
- [快速开始](#快速开始)
28-
- [安装](#安装)
29-
- [用法](#用法)
30-
- [Android](#android)
31-
- [iOS](#ios)
32-
- [macOS](#macos)
33-
- [Windows](#windows)
34-
- [监听事件](#监听事件)
35-
- [谁在用使用它?](#谁在用使用它)
36-
- [许可证](#许可证)
22+
- [平台支持](#%E5%B9%B3%E5%8F%B0%E6%94%AF%E6%8C%81)
23+
- [截图](#%E6%88%AA%E5%9B%BE)
24+
- [快速开始](#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)
25+
- [安装](#%E5%AE%89%E8%A3%85)
26+
- [用法](#%E7%94%A8%E6%B3%95)
27+
- [Android](#android)
28+
- [iOS](#ios)
29+
- [macOS](#macos)
30+
- [Windows](#windows)
31+
- [监听事件](#%E7%9B%91%E5%90%AC%E4%BA%8B%E4%BB%B6)
32+
- [谁在用使用它?](#%E8%B0%81%E5%9C%A8%E7%94%A8%E4%BD%BF%E7%94%A8%E5%AE%83)
33+
- [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)
3734

3835
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3936

4037
## 平台支持
4138

42-
| Android | iOS | Linux | macOS | Windows |
43-
| :-----: | :---: | :---: | :---: | :-----: |
44-
| ✔️ | ✔️ | | ✔️ | ✔️ |
39+
| Android | iOS | Linux | macOS | Windows |
40+
| :-----: | :-: | :---: | :---: | :-----: |
41+
| ✔️ | ✔️ || ✔️ | ✔️ |
4542

4643
## 截图
4744

@@ -55,7 +52,7 @@ https://user-images.githubusercontent.com/3889523/167283452-aff2535b-c322-45c7-9
5552

5653
```yaml
5754
dependencies:
58-
protocol_handler: ^0.1.6
55+
protocol_handler: ^0.2.0
5956
```
6057
6158
@@ -69,6 +66,7 @@ dependencies:
6966
```
7067
7168
### 用法
69+
7270
##### Android
7371
7472
更改文件 `android/app/src/main/AndroidManifest.xml` 如下:
@@ -237,7 +235,6 @@ dependencies:
237235
<string>NSApplication</string>
238236
</dict>
239237
</plist>
240-
}
241238
```
242239

243240
##### Windows
@@ -302,6 +299,13 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
302299
}
303300
```
304301

302+
如果你使用 `MSIX` 打包应用,需要在 `msix_config` 中添加 `protocol_activation` 配置:
303+
304+
```yaml
305+
msix_config:
306+
protocol_activation: myprotocol
307+
```
308+
305309
```dart
306310
import 'package:protocol_handler/protocol_handler.dart';
307311
@@ -324,7 +328,7 @@ class HomePage extends StatefulWidget {
324328
const HomePage({Key? key}) : super(key: key);
325329
326330
@override
327-
_HomePageState createState() => _HomePageState();
331+
State<HomePage> createState() => _HomePageState();
328332
}
329333
330334
class _HomePageState extends State<HomePage> with ProtocolListener {

README.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# protocol_handler
22

3-
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] ![][visits-count-image]
3+
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] ![][visits-count-image]
44

55
[pub-image]: https://img.shields.io/pub/v/protocol_handler.svg
66
[pub-url]: https://pub.dev/packages/protocol_handler
7-
87
[discord-image]: https://img.shields.io/discord/884679008049037342.svg
98
[discord-url]: https://discord.gg/zPa6EZ2jqb
10-
119
[visits-count-image]: https://img.shields.io/badge/dynamic/json?label=Visits%20Count&query=value&url=https://api.countapi.xyz/hit/leanflutter.protocol_handler/visits
1210

1311
This plugin allows Flutter apps to register and handle custom protocols (i.e. deep linking).
@@ -21,27 +19,26 @@ English | [简体中文](./README-ZH.md)
2119
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2220
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2321

24-
- [protocol\_handler](#protocol_handler)
25-
- [Platform Support](#platform-support)
26-
- [Screenshots](#screenshots)
27-
- [Quick Start](#quick-start)
28-
- [Installation](#installation)
29-
- [Usage](#usage)
30-
- [Android](#android)
31-
- [iOS](#ios)
32-
- [macOS](#macos)
33-
- [Windows](#windows)
34-
- [Listening events](#listening-events)
35-
- [Who's using it?](#whos-using-it)
36-
- [License](#license)
22+
- [Platform Support](#platform-support)
23+
- [Screenshots](#screenshots)
24+
- [Quick Start](#quick-start)
25+
- [Installation](#installation)
26+
- [Usage](#usage)
27+
- [Android](#android)
28+
- [iOS](#ios)
29+
- [macOS](#macos)
30+
- [Windows](#windows)
31+
- [Listening events](#listening-events)
32+
- [Who's using it?](#whos-using-it)
33+
- [License](#license)
3734

3835
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3936

4037
## Platform Support
4138

42-
| Android | iOS | Linux | macOS | Windows |
43-
| :-----: | :---: | :---: | :---: | :-----: |
44-
| ✔️ | ✔️ | | ✔️ | ✔️ |
39+
| Android | iOS | Linux | macOS | Windows |
40+
| :-----: | :-: | :---: | :---: | :-----: |
41+
| ✔️ | ✔️ || ✔️ | ✔️ |
4542

4643
## Screenshots
4744

@@ -55,7 +52,7 @@ Add this to your package's pubspec.yaml file:
5552

5653
```yaml
5754
dependencies:
58-
protocol_handler: ^0.1.6
55+
protocol_handler: ^0.2.0
5956
```
6057
6158
Or
@@ -238,7 +235,6 @@ Change the file `macos/Runner/Info.plist` as follows:
238235
<string>NSApplication</string>
239236
</dict>
240237
</plist>
241-
}
242238
```
243239

244240
##### Windows
@@ -303,6 +299,15 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
303299
}
304300
```
305301

302+
If you use `MSIX` to package your application, you need to add `protocol_activation` configuration in `msix_config`:
303+
304+
```yaml
305+
msix_config:
306+
protocol_activation: myprotocol
307+
```
308+
309+
> See this issue for details: [YehudaKremer/msix#187](https://github.com/YehudaKremer/msix/issues/187)
310+
306311
```dart
307312
import 'package:protocol_handler/protocol_handler.dart';
308313
@@ -325,7 +330,7 @@ class HomePage extends StatefulWidget {
325330
const HomePage({Key? key}) : super(key: key);
326331
327332
@override
328-
_HomePageState createState() => _HomePageState();
333+
State<HomePage> createState() => _HomePageState();
329334
}
330335
331336
class _HomePageState extends State<HomePage> with ProtocolListener {

0 commit comments

Comments
 (0)