![](/img/trans.png)
[英]How to open flutter web app in browser just like a html file
[英]How to open flutter app from any web browser?
您无法从 web 浏览器的搜索栏调用深层链接 URL。 首先,您需要创建一个 HTML 页面。 然后你可以点击链接。 它会起作用。
就我而言,我创建了一个带有深层链接的 HTML 文件,并将其发送到我的 email。
HTML 档案
<a href="myapp://test">Open my app</a>
AndroidManifest.xml
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="test"
android:scheme="myapp" />
</intent-filter>
对于 Flutter 应用程序,权限的配置方式与相应的原生配置完全相同。 安卓 :
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="poc"
android:host="deeplink.flutter.dev" />
</intent-filter>
IOS:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>deeplink.flutter.dev</string>
<key>CFBundleURLSchemes</key>
<array>
<string>poc</string>
</array>
</dict>
</array>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.