声明式http客户端,依赖库 WebApiClientCore
Install-Package GeTuiPushV2
services
.AddGeTuiPush(x =>
{
x.AppId = "xxx";
x.AppKey = "xxx";
x.MasterSecret = "xxx";
})
//添加默认日志输出
//.AddDefaultLogger()
;
推送 API 直接使用即可,系统会自动维护 token
private readonly IPushApi _pushApi;
var input = new PushSingleAliasInput
{
//...
};
var result = await _pushApi.PushSingleAliasAsync(input)
//如果返回错误,会抛出异常
.EnsureThrowErrorAsync();
接口名 | 方法名 | 类别 | 说明 |
---|---|---|---|
IAuthApi | CreateTokenAsync | 鉴权API | 获取鉴权 |
IAuthApi | DeleteTokenAsync | 鉴权API | 删除鉴权 |
IPushApi | PushSingleCidAsync | 推送API | [toSingle]执行cid单推 |
IPushApi | PushSingleAliasAsync | 推送API | [toSingle]执行别名单推 |
IPushApi | PushSingleBatchCidAsync | 推送API | [toSingle]执行cid批量单推 |
IPushApi | PushSingleBatchAliasAsync | 推送API | [toSingle]执行别名批量单推 |
IPushApi | CreateListMessage | 推送API | [toList]创建消息 |
IPushApi | PushListCidAsync | 推送API | [toList]执行cid批量推 |
IPushApi | PushListAliasAsync | 推送API | [toList]执行别名批量推 |
IPushApi | PushAllAsync | 推送API | [toApp]执行群推 |
IPushApi | PushTagAsync | 推送API | [toApp]根据条件筛选用户推送 |
IPushApi | PushFastCustomTagAsync | 推送API | [toApp]使用标签快速推送 |
IPushApi | StopTaskAsync | 推送API | [任务]停止任务 |