kydev/umeng-sdk

UMeng Open Api SDK

dev-main / 0.1.x-dev 2022-05-28 04:03 UTC

This package is auto-updated.

Last update: 2024-11-28 09:38:59 UTC


README

文档

open-api

安装

composer require kydev/umeng-sdk

使用

use KY\UMeng\AppTrack\UMengAppTrackAppDownload;
use KY\UMeng\Client\APIId;
use KY\UMeng\Client\APIRequest;
use KY\UMeng\Client\Policy\ClientPolicy;
use KY\UMeng\Client\Policy\RequestPolicy;
use KY\UMeng\Client\SyncAPIClient;
use KY\UMeng\UApp\UMengUAppGetDailyDataParam;
use KY\UMeng\UApp\UMengUAppGetDailyDataResult;

$syncAPIClient = new SyncAPIClient(new ClientPolicy(
    '123',
    'xxx',
    'gateway.open.umeng.com'
));

$reqPolicy = new RequestPolicy(useHttps: true);

$param = new UMengUAppGetDailyDataParam();
$param->key = 'xxx';
$param->date = '2022-05-01';

$request = new APIRequest(
    new APIId('com.umeng.uapp', 'umeng.uapp.getDailyData', 1),
    $param
);

$res = $syncAPIClient->send($request, UMengUAppGetDailyDataResult::class, $reqPolicy);

var_dump($res);