简体   繁体   English

如何从 Flutter 应用程序打开另一个应用程序(我自己的应用程序)?

[英]how to open another app(my own app) from Flutter app?

I have two applications.我有两个应用程序。 customer app and vendor app.客户应用程序和供应商应用程序。 How to open vendor app from customer app when click button ?单击按钮时如何从客户应用程序打开供应商应用程序?

Is it possible to open another application from the Flutter app?是否可以从 Flutter 应用程序中打开另一个应用程序?

com.demo.customer and com.demo.vendor com.demo.customercom.demo.vendor

I tried url_launcher .我试过url_launcher but It cannot give package name and open another application.但它不能提供包名称并打开另一个应用程序。

And also I tried this package, device_apps but not working for ios.我也试过这个包, device_apps,但不适用于 ios。

Should be work on Android and ios.应该适用于Android和ios。

You need to register a custom url scheme for the app you want to open.您需要为要打开的应用程序注册自定义url 方案

You can read more here:你可以在这里阅读更多:

For iOS: iOS Documentation对于 iOS: iOS 文档

For Android: Android Documentation对于 Android: Android 文档

There's also a nice plugin that can handle deeplink actions for Flutter.还有一个很好的插件可以处理 Flutter 的深层链接操作。

Flutter Uni Links Flutter Uni 链接

When you have registered a custom url scheme (for example: demo://vendor) you can just call that url with url_launcher plugin:当您注册了自定义 url 方案(例如:demo://vendor)时,您可以使用url_launcher插件调用该 url:

launchUrl('demo://vendor')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM