本文整理匯總了PHP中WhatsProt::sendBroadcastAudio方法的典型用法代碼示例。如果您正苦於以下問題:PHP WhatsProt::sendBroadcastAudio方法的具體用法?PHP WhatsProt::sendBroadcastAudio怎麽用?PHP WhatsProt::sendBroadcastAudio使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WhatsProt
的用法示例。
在下文中一共展示了WhatsProt::sendBroadcastAudio方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendBroadcast
/**
* Sends a broadcast Message to a group of contacts.
*
* Currenly only sends a normal message to
* a group of contacts.
*
* @param $toNumbers
* @param $message
* @param $type
* @return array|null|string
*/
public function sendBroadcast($toNumbers, $message, $type)
{
$this->connectToWhatsApp();
$messagesId = array();
if ($type === self::MESSAGE_TYPE_TEXT) {
$messagesId = $this->wa->sendBroadcastMessage($toNumbers, $message);
}
if ($type === self::MESSAGE_TYPE_IMAGE) {
$messagesId = $this->wa->sendBroadcastImage($toNumbers, $message);
}
if ($type === self::MESSAGE_TYPE_AUDIO) {
$messagesId = $this->wa->sendBroadcastAudio($toNumbers, $message);
}
if ($type === self::MESSAGE_TYPE_VIDEO) {
$messagesId = $this->wa->sendBroadcastVideo($toNumbers, $message);
}
if ($type === self::MESSAGE_TYPE_LOCATION) {
$messagesId = $this->wa->sendBroadcastLocation($toNumbers, $message['userlong'], $message['userlat'], $message['locationname'], null);
}
return $messagesId;
}