友盟统计分析 hyper-umeng 组件
友盟统计分析 OpenApi hyperf 版本
Why
由于工作内容中需要大量用到友盟统计分析 OpenApi,但是友盟官方的 OpenApi SDK 实在辣眼,于是就有了本项目。
Installation
composer require suyar/hyperf-umeng
Usage
- Inject
php bin/hyperf.php vendor:publish suyar/hyperf-umeng
namespace App\Controller;
use Hyperf\Di\Annotation\Inject;
use Suyar\Umeng\Umeng;
class IndexController
{
#[Inject]
protected Umeng $umeng;
public function index()
{
return $this->umeng->uapp->getAllAppData();
}
}
- Factory
namespace App\Controller;
use Hyperf\Di\Annotation\Inject;
use Suyar\Umeng\UmengFactory;
class IndexController
{
#[Inject]
protected UmengFactory $umengFactory;
public function index()
{
$umeng = $this->umengFactory->create('apiKey', 'apiSecret');
return $umeng->uapp->getAllAppData();
}
}
Methods
$umeng->uapp; // U-App-移动统计.
$umeng->appTrack; // AppTrack-移动广告监测.
$umeng->umini; // U-MiniProgram-小程序统计.
Refer:
Contact
License
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: