发送链接到直接从浏览器的WhatsApp组(或应用程序)应用程序、浏览器、直接、链接

2023-09-05 01:59:47 作者:男神塑造中i

我想使用户能够使用WhatsApp的组共享URL +文字。我想这无论是从iPhone和机器人的工作。但是我的应用程序是在浏览器中(这是一个网站)。我目前正在研究2种选择,但都有问题:

1),第一个可能的解决方案 - 直接从浏览器共享

我检查了 并用下面的网址,通过我的应用程序共享的WhatsApp的URL方案:

 WhatsApp的:?!//发送文本=您好%2C%20World
 

但是有几个问题,这个方法:

这似乎只与iPhone和不与机器人的工作。有没有一种解决方案相媲美的地方机器人? 这使得选择向谁发送到只有在您被重定向到WhatsApp的,除非你知道用户的地址簿中的ID(= 阿比德)。首先,我不知道如何访问用户的阿比德?其次,我想发送给一组,在这种情况下,没有阿比德(右),因此,它似乎是不可能做到这一点。真的吗? 此外,什么for Android应用程序会发生什么?什么是堪比阿比德,为一组,以及如何得到它?

2)第二个潜在的解决方案 - 创建本机应用程序,这是等同于基于浏览器的应用程序,但这一特定部分(这是我们的共享)是本机

不过,在我看来,在这种情况下,我有非常相似的问题,上述的:

我可以看到如何在WhatsApp的网站做到这一点的iOS(见上面的链接)。然而,这与Android原生应用程序的WhatsApp的URL方案的工作呢? 同样,地址簿ID问题是相同的。如何获得呢?这可能是更容易得到iOS上的阿比德因为我们现在是本机应用程序,但它存在一组?又有怎样的Andr​​oid应用程序?请问这个份额的WhatsApp工作组的工作呢? 解决方案

在Android中,你可以从一个应用程序使用意向邀请朋友,请参见下面的code

 最后组件名名称=新的组件名(com.whatsapp,com.whatsapp.ContactPicker);
意图oShareIntent =新意图();
oShareIntent.setComponent(名称);
oShareIntent.setType(text / plain的);
oShareIntent.putExtra(android.content.Intent.EXTRA_TEXT,您的信息);
startActivity(oShareIntent);
 

我希望这能解决你的问题。

WhatsApp将让您直接在应用程序中浏览公司的产品

I want to enable users to share a URL+ text with a WhatsApp group. I want this to work both from iPhones and Androids. However my app is in a browser (it's a website). I'm currently looking into 2 options, but both have issues:

1) The first potential solution - sharing directly from the browser.

I checked out WhatsApp's URL schema and used the following URL to share through my app:

"whatsapp://send?text=Hello%2C%20World!" 

However there were several problems with this approach:

It seems to work only with iPhones and not with Androids. Is there a comparable solution somewhere for Androids? It enables to choose who to send to only after you are redirected to WhatsApp, unless you know the address book ID (=abid) of the user. First, I do not know how to access the abid of users? Second, I am trying to send to a group, in which case there is no abid (right?), and therefore it seems impossible to do this. Is that true? Also, what happens for Android apps? What is the comparable to the abid, for a group, and how do I get it?

2) The second potential solution - creating a native app which is identical with the browser-based app, but this specific part (where we do the "sharing") is native.

However, it seems to me that in this case I have very similar problems to the ones described above:

I can see how to do this for iOS on WhatsApp's website (see the link above). However, does the WhatsApp URL schema work with Android native apps as well? Again, the address book ID issue is the same. How do I get it? It may be easier to get the abid on iOS given that we are now a native app, but does it exist for a group? And how about the Android app? Would this share to WhatsApp group work there?

解决方案

in Android you can invite friends from an app using Intent, see the following Code

final ComponentName name = new ComponentName("com.whatsapp", "com.whatsapp.ContactPicker");
Intent oShareIntent = new Intent();
oShareIntent.setComponent(name);
oShareIntent.setType("text/plain");
oShareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Your Message");
startActivity(oShareIntent);

I hope this solves your problem