link_kit
Flutter plugin for App/Deep Link.
Android
- 配置
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "flk://link.kit/power"
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "flks://link.kit/power"
iOS
- 配置
key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<!-- 固定标志 -->
<string>flk</string>
<key>CFBundleURLSchemes</key>
<array>
<!-- scheme 为必选项,可自定义 -->
<string>flk</string>
<!-- 可定义多个 -->
<string>flks</string>
</array>
</dict>
</array>
- 测试
xcrun simctl openurl booted flk://link.kit/power
xcrun simctl openurl booted flks://link.kit/power
Flutter
_linkClickSubs = Link.instance.linkClickStream().listen((String event) {
if (kDebugMode) {
print('linkClick: $event');
}
});
Link.instance.getInitialLink().then((String? value) {
if (kDebugMode) {
print('initialLink: $value');
}
});