简体   繁体   English

如何使用移动应用程序到whatsapp共享链接中工作?

[英]How to use mobile app into whatsapp share link working?

How do you use an HTML link to open the whatsapp on a mobile app ? 您如何使用HTML链接在移动应用程序上打开whatsapp? this link works on website Example link: <a href="whatsapp://send?text=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F51533526%2Fhow-to-use-html-link-into-whatsapp-mobile-app%2F51533716%3Fnoredirect%3D1">Whatsapp Share </a> 此链接可在网站上使用示例链接: <a href="whatsapp://send?text=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F51533526%2Fhow-to-use-html-link-into-whatsapp-mobile-app%2F51533716%3Fnoredirect%3D1">Whatsapp Share </a>

This link is failing in the WhatsApp mobile app. WhatsApp移动应用程序中此链接失败。

This is the error message: 这是错误消息:

ERR_UNKNOWN_URL_SCHEME ERR_UNKNOWN_URL_SCHEME

(same error => app into phone number click) I want to solve this problem on the front end side. (相同错误=>应用程序进入电话号码单击)我想在前端侧解决此问题。

The below code directly shares the Text to the Whatsapp app using Intent. 以下代码使用Intent直接将文本共享给Whatsapp应用。

Intent textIntent = new Intent(Intent.ACTION_SEND);
textIntent.setType("text/plain");
textIntent.setPackage("com.whatsapp");
textIntent.putExtra(Intent.EXTRA_TEXT, "Your text here");
startActivity(textIntent);

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

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