如何使用移动应用程序到whatsapp共享链接中工作? [英] How to use mobile app into whatsapp share link working?
问题描述
如何使用HTML链接在移动应用程序上打开whatsapp?此链接可在网站上使用示例链接:<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>
How do you use an HTML link to open the whatsapp on a mobile app ? 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>
WhatsApp移动应用程序中的此链接失败.
This link is failing in the WhatsApp mobile app.
这是错误消息:
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.
推荐答案
以下代码使用Intent将文本直接共享到Whatsapp应用.
The below code directly shares the Text to the Whatsapp app using Intent.
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);
这篇关于如何使用移动应用程序到whatsapp共享链接中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!