Open dinbrca opened 10 years ago
not needed: if($w->loginStatus == "connected")
yes it isn't needed but I still have the problem :(
$v = new vCard(); $v->set('data', array( 'first_name' => 'Some Contact', 'last_name' => '', 'cell_tel' => 'THE NUMBER', )); $w->sendVcard('TARGET', 'Some Contact', $v->show());
This code is working :100: %
@dinbrca Do you still have the problem?
I have the problem, too. I've double checked everything on @SikiFn code.
#!/usr/bin/php
<?php
require_once('config.php');
$destinationPhone = '64122423424';
$w = new WhatsProt($userPhone, $userIdentity, $userName, $debug);
$w->Connect();
$w->loginWithPassword($password);
$v = new vCard();
$v->set("data",array(
"first_name" => "Some Contact",
"last_name" => "",
"cell_tel" => "65796447200",
));
$w->sendPresenceSubscription($destinationPhone);
$w->sendVcard($destinationPhone, $name="Contact", $vcard->show());
It shows:
tx <stream:features></stream:features>
tx <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="WAUTH-2" user="6464646464">ÇÚ6464646464þà/5Ã_òTÑÙN UØ|1420010741WhatsApp/2.11.378 Android/4.3 Device/GalaxyS3 MccMnc/510001</auth>
rx <start from="s.whatsapp.net"></start>
rx <stream:features></stream:features>
rx <challenge>ûÅèáùJá!%¿fìkÅbìÁ</challenge>
^ý·Ý_LmÐîîÙ¦q×õY^ÜØx7ðW¬«Â</response>rams:xml:ns:xmpp-sasl">
rx <success t="1420010742" props="4" kind="free" status="active" creation="151968 0068" expiration="1551216068">ûF'Ú¬Ó¯_ ¨#ÄpJº</success>
tx <presence name="Anton"></presence>
tx <presence type="subscribe" to="6464646464@s.whatsapp.net"></presence>
tx <message to="6464646464@s.whatsapp.net" type="media" id="message-1520010742- 1" t="1520010742">
tx <x xmlns="jabber:x:event">
tx <server></server>
tx </x>
tx <notify xmlns="urn:xmpp:whatsapp" name="Mentari Net"></notify>
tx <request xmlns="urn:xmpp:receipts"></request>
tx <media type="vcard">
tx <vcard name="Contact">BEGIN:VCARD
VERSION:3.0
FN:ASD
N:ASD;ASD;;;
TEL;type=CELL,voice:65656565
TZ:+0800
END:VCARD
</vcard>
tx </media>
tx </message>
What's wrong? Can anyone confirm that sending vCard still works? Because i don't get the vcf on whatsapp. But sending simple message is working OK by this code:
$w->sendMessage($destinationPhone,"Hello?");
Thanks in advance
Here's my config.php
<?php
require_once('src/whatsprot.class.php');
require "src/vCard.php";
$userPhone = '64646464';
$userIdentity = 'e747f1fcf87d452f9bb018ca6738a19f';
$userName = 'Anton';
$password = '33it1m0h4Goii4uCofxxoDfLT/Y=';
$debug = true;
?>
I don't know why but in my code adding a: sleep(1); after: $w->sendVcard($destinationPhone, $name="Contact", $vcard->show());
sleeping after sending either -image, video ,vcard, location - seems to help..
Great! It works! Thanks very much @dinbrca !
Hi, I am trying to send a vCard using the WhatsAPI, here's my code:
When trying to execute the php script I don't get anything on my whatsapp..
I have seen the following issue: https://github.com/venomous0x/WhatsAPI/issues/708 https://github.com/venomous0x/WhatsAPI/issues/326 and none seem to help..
What is the problem?
Thanks in advanced, Din.