netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
428 stars 151 forks source link

Duplicate messages #106

Closed neolium closed 10 months ago

neolium commented 1 year ago

Hi Thanks for this nice lib. Sadly since moving from test to prod and all messages i send are sent twice...

Does anyone how to fix this issue?

Thanks in advance.

Kind regards

aalbarca commented 1 year ago

Hi @neolium the lib is working right. Please, check your code, maybe is wrong ^^

Thanks.

neolium commented 1 year ago
<?php

// Require the Composer autoloader.
require 'vendor/autoload.php';

use Netflie\WhatsAppCloudApi\WhatsAppCloudApi;

// Instantiate the WhatsAppCloudApi super class.
$whatsapp_cloud_api = new WhatsAppCloudApi([
    'from_phone_number_id' => '113670928384135',
    'access_token' => '',
]);
/*
echo "<pre>";
    print_r($whatsapp_cloud_api);
echo "</pre>";
*/
$whatsapp_cloud_api->sendTextMessage('41', 'Hey there!');
?>

Nothing special tho 👯 When i try to use the API from WA-Business via Curl it works and i only get one message...