引用极光官方类库,或下载提供的资源。
JpushEvents.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Jiguang.JSMS;
using Jiguang.JSMS.Model;
namespace NjswAppClass.Jpush
{
/// <summary>
/// 极光推送
/// </summary>
public class JpushEvents
{
/// <summary>
/// 发送文本验证码短信。
/// <see cref="https://docs.jiguang.cn/jsms/server/rest_api_jsms/#api_1"/>
/// </summary>
public static string SendCode(string tel,int signId)
{
try
{
JSMSClient jsmsClient = new JSMSClient(PublicValue.jpush_app_key, PublicValue.jpush_master_secret);
HttpResponse httpResponse = jsmsClient.SendCode(tel, 1, signId);
return httpResponse.Content;
}
catch (Exception er)
{
return er.Mess