【发布时间】:2020-03-27 06:43:24
【问题描述】:
我有两个应用程序。客户应用程序和供应商应用程序。 点击按钮时如何从客户应用打开供应商应用?
是否可以从 Flutter 应用打开另一个应用?
com.demo.customer 和 com.demo.vendor
我试过url_launcher。但它不能给出包名并打开另一个应用程序。
我也试过这个包,device_apps 但不适用于 ios。
应该可以在 Android 和 ios 上运行。
【问题讨论】:
我有两个应用程序。客户应用程序和供应商应用程序。 点击按钮时如何从客户应用打开供应商应用?
是否可以从 Flutter 应用打开另一个应用?
com.demo.customer 和 com.demo.vendor
我试过url_launcher。但它不能给出包名并打开另一个应用程序。
我也试过这个包,device_apps 但不适用于 ios。
应该可以在 Android 和 ios 上运行。
【问题讨论】:
您需要为要打开的应用注册自定义url方案。
您可以在这里阅读更多内容:
对于 iOS:iOS Documentation
还有一个不错的插件可以处理 Flutter 的 deeplink 动作。
当您注册了自定义 url 方案(例如:demo://vendor)后,您可以使用 url_launcher 插件调用该 url:
launchUrl('demo://vendor')
【讨论】: