简体   繁体   English

使用JavaScript在Windows Mobile上注册自定义href协议

[英]Registering a Custom href Protocol on Windows Mobile in JavaScript

I am developing a web-based mobile application, My application has a button that takes the user to the dialer where a USSD code is ready for the user to dial. 我正在开发一个基于Web的移动应用程序,我的应用程序有一个按钮,可将用户带到拨号器,在该拨号器中,USSD代码可供用户拨号。 This works fine on Android Devices and iOS devices. 在Android设备和iOS设备上运行良好。

 <a href="tel:*222*263000000000#">Trigger USSD</a> 

On Windows 10 Mobile that link triggers the People App or the Skype App. 在Windows 10移动版上,该链接会触发People应用程序或Skype应用程序。 If this was a native app I know I could register a URI protocol to trigger the dialer. 如果这是一个本机应用程序,我知道我可以注册一个URI协议来触发拨号程序。 Is there a workaround in JavaScript I can use to target the dialer (Or Phone App) specifically such as registering a custom href protocol maybe. JavaScript中是否有解决方法,我可以使用它专门针对拨号程序(或Phone App),例如注册自定义href协议。

For my understanding, like you said, the app itself is responsible for registering custom URI or catch the intent of existing URI, even from the browser. 就我的理解而言,就像您说的那样,该应用程序本身负责注册自定义URI或捕获现有URI的意图,甚至可以从浏览器中获取。 On Android, the user can choose from all the application that catch the intent what application he wants to use. 在Android上,用户可以从所有捕获意图的应用程序中选择想要使用的应用程序。

I think that the answer should be what kind of protocol the Phone app uses, then use this protocol in order to 'target' the dialer. 我认为答案应该是电话应用程序使用哪种协议,然后使用此协议以“定位”拨号程序。

似乎没有公开任何Phone应用程序的协议,但是您可以使用PhoneCallManager.showPhoneCallUI方法启动具有指定电话号码和显示名称的内置电话UI。

Windows.ApplicationModel.Calls.PhoneCallManager.showPhoneCallUI(phoneNumber, displayName);

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

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