dadapush/dadapush-php-client

DaDaPush:实时通知应用通过我们的API发送实时通知,无需编写和维护iOS或Android设备上的应用。

dev-master 2019-07-30 04:07 UTC

This package is auto-updated.

Last update: 2024-09-29 06:02:37 UTC


README

DaDaPush:实时通知应用

通过我们的API发送实时通知,无需编写和维护iOS或Android设备上的应用。

此PHP包由OpenAPI Generator项目自动生成

  • API版本:v1
  • 包版本:1.0.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen。更多信息,请访问https://www.dadapush.com

要求

PHP 5.5及以后版本

安装与使用

Composer

要使用Composer安装绑定,请将以下内容添加到composer.json

{
    "require": {
        "dadapush/dadapush-php-client": "1.0.0"
    }
}

或使用git仓库

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/dadapush/dadapush-php-client.git"
    }
  ],
  "require": {
    "dadapush/dadapush-php-client": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/DaDaPushClient/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请按照安装和用法说明进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new DaDaPushClient\Api\DaDaPushMessageApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = new \DaDaPushClient\Model\MessagePushRequest(); // \DaDaPushClient\Model\MessagePushRequest | body
$x_channel_token = 'x_channel_token_example'; // string | see: https://www.dadapush.com/channel/list

try {
    $result = $apiInstance->createMessage($body, $x_channel_token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DaDaPushMessageApi->createMessage: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI均相对于https://www.dadapush.com

模型文档

作者

contacts@dadapush.com