56 lines
2.3 KiB
Java
56 lines
2.3 KiB
Java
package com.onekeycall.videotablet.utils;
|
|
|
|
import com.aliyun.auth.credentials.Credential;
|
|
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
|
|
import com.aliyun.credentials.models.Config;
|
|
import com.aliyun.sdk.service.dysmsapi20170525.AsyncClient;
|
|
import com.aliyun.sdk.service.push20160801.models.PushRequest;
|
|
import com.aliyun.sdk.service.push20160801.models.PushResponse;
|
|
import com.google.gson.Gson;
|
|
import darabonba.core.client.ClientOverrideConfiguration;
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import com.aliyun.tea.*;
|
|
import com.aliyun.push20160801.*;
|
|
import com.aliyun.push20160801.models.*;
|
|
import com.aliyun.teaopenapi.*;
|
|
import com.aliyun.teaopenapi.models.*;
|
|
import com.aliyun.teautil.*;
|
|
|
|
public class PushUtils {
|
|
// public static com.aliyun.push20160801.Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
|
|
// Config config = new Config();
|
|
// // 您的AccessKey ID
|
|
// config.accessKeyId = accessKeyId;
|
|
// // 您的AccessKey Secret
|
|
// config.accessKeySecret = accessKeySecret;
|
|
// config.regionId = "cn-hangzhou";
|
|
// return new com.aliyun.push20160801.Client(config);
|
|
// }
|
|
//
|
|
// public static void aliyunAsyncPush( String message, String title) {
|
|
//
|
|
// java.util.List<String> args = java.util.Arrays.asList(args_);
|
|
// com.aliyun.push20160801.Client client = Sample.createClient(com.aliyun.darabonba.env.EnvClient.getEnv("ACCESS_KEY_ID"), com.aliyun.darabonba.env.EnvClient.getEnv("ACCESS_KEY_SECRET"));
|
|
// PushRequest request = new PushRequest()
|
|
// .setAppKey(com.aliyun.darabonbanumber.Client.parseLong(args.get(0)))
|
|
// .setPushType("MESSAGE")
|
|
// .setDeviceType("ALL")
|
|
// .setStoreOffline(true)
|
|
// .setIOSRemind(true)
|
|
// .setAndroidRemind(true)
|
|
// .setTarget("DEVICE")
|
|
// .setTargetValue(args.get(1))
|
|
// .setTitle(args.get(2))
|
|
// .setBody(args.get(3))
|
|
// .setIOSRemindBody(args.get(4))
|
|
// .setAndroidPopupTitle(args.get(5))
|
|
// .setAndroidPopupBody(args.get(6));
|
|
// PushResponse response = client.push(request);
|
|
// com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(TeaModel.buildMap(response.body)));
|
|
// }
|
|
|
|
|
|
|
|
}
|