定制 andreasanta/nexmo-php-lib 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andreasanta/nexmo-php-lib

Composer 安装命令:

composer require andreasanta/nexmo-php-lib

包简介

README 文档

README

Sending SMS via the Nexmo SMS gateway.

Quick Examples

  1. Sending an SMS
$sms = new NexmoMessage('account_key', 'account_secret');
$sms->sendText( '+447234567890', 'MyApp', 'Hello world!' );
  1. Recieving SMS
$sms = new NexmoMessage('account_key', 'account_secret');
if ($sms->inboundText()) {
    $sms->reply('You said: ' . $sms->text);
}
  1. Recieving a message receipt
$receipt = new NexmoReceipt();
if ($receipt->exists()) {
    switch ($receipt->status) {
        case $receipt::STATUS_DELIVERED:
             // The message was delivered to the handset!
             break;
         
         case $receipt::STATUS_FAILED:
         case $receipt::STATUS_EXPIRED:
             // The message failed to be delivered
             break;
    }
}
  1. List purchased numbers on your account
$account = new NexmoAccount('account_key', 'account_secret');
$numbers = $account->numbersList();

Most Frequent Issues

Sending a message returns false.

This is usually due to your webserver unable to send a request to Nexmo. Make sure the following are met:

  1. Either CURL is enabled for your PHP installation or the PHP option allow_url_fopen is set to 1 (default).

  2. You have no firewalls blocking access to rest.nexmo.com/sms/json on port 443.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 95
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-05-05