协议激活到当前应用程序 [英] Protocol Activation into current app

查看:70
本文介绍了协议激活到当前应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在我们的应用程序中使用WebView并希望处理协议前缀 "myApp://",因此我们注册了"myApp"。

We are using the WebView in our application and want to handle the protocol prefix "myApp://", so we registered for "myApp".

如果用户现在点击了以 "myApp://"开头的链接,则协议激活会识别出这一点。出现MessageDialog,询问用户是否允许更改应用程序。但实际上目标应用程序与
源应用程序相同。那么我怎么能抑制Dialog("MyApp试图打开MyApp")?

If the user now clicks an links starting with "myApp://", the protocol activation recognizes this. An MessageDialog appears, asking the user if he wants to allow to change the application. But actually the target application is the same as the source application. So how can I supress the Dialog ("MyApp is trying to open MyApp")?

推荐答案

我不相信你可以永远禁止协议激活作为安全措施。 协议是操作系统的全局。  如果另一个应用程序已注册该协议,该对话框将显示一个选择器。

I don't believe you can ever suppress protocol activation as a security measure.  Protocols are global to the OS.  If another app has registered that protocol, the dialog would show a picker.

我建议您最终使您的协议独一无二。

I would suggest that you also make your protocol unique in the end.

我解决问题的建议是点击一个jscript例程运行,而不是做一个链接,将事件提升到应用程序并让应用程序采取相应的行动。

My recommendation to solve your problem is to have a jscript routine run on click, and instead of doing a link, raise the event to the app and have the app act accordingly.


这篇关于协议激活到当前应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆