VUE应用程序的Android意图
如何从vue-web-app中发送Android意图?
例如,启动外部应用以扫描条形码并返回条形码号码。
我有一个在浏览器环境中运行的VUE Web应用程序,我想启动一个本机Android应用以扫描条形码。如何从此Vue-Web-App中发送“ Android意图”以实现这一目标?例如,我需要一个特定的插件吗?
How can I send an android intent from a vue-web-app?
For example to start an external app to scan a barcode and return the barcode number.
I have a vue web app which runs in a browser environment and I want to start a native android app to scan a barcode. How can I send an "android intent" from this vue-web-app to achieve this? Do I need a specific plugin for example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要启动的应用程序需要在意图过滤器中定义自定义URL方案。在这种情况下,您将有一个像这样的URI:
demoapp:// scan?type = 128
当您的Vue应用程序将其重定向到这样的URI时,请在Android电话(安装了应用程序)将启动意图并启动随着相应活动的启动。
The app you're trying to start needs to have a custom URL scheme defined in the intent filter. In that case you'll have an URI looking like this:
demoapp://scan?type=128
When your Vue app redirects to an URI like this on an Android phone (with the app installed) it will pick up the intent and launch the app with corresponding activity started.