https://docs.jiguang.cn/jpush/resources/

下载后有完整的例子

引用 Jiguang.JPush.dll

using System;
using Jiguang.JPush;
using Jiguang.JPush.Model;
using System.Collections.Generic; namespace Example
{
class Example
{
private static JPushClient client = new JPushClient("Your AppKey", "Your MasterSecret"); public static void Main(string[] args)
{
ExecutePushExample();
ExecuteDeviceEample();
ExecuteReportExample();
ExecuteScheduleExample(); Console.ReadLine();
} private static void ExecutePushExample()
{
PushPayload pushPayload = new PushPayload()
{
Platform = new List<string> { "android", "ios" },
Audience = "all",
Notification = new Notification
{
Alert = "hello jpush",
Android = new Android
{
Alert = "android alert",
Title = "title"
},
IOS = new IOS
{
Alert = "ios alert",
Badge = "+1"
}
},
Message = new Message
{
Title = "message title",
Content = "message content",
Extras = new Dictionary<string, string>
{
["key1"] = "value1"
}
},
Options = new Options
{
IsApnsProduction = true // 设置 iOS 推送生产环境。不设置默认为开发环境。
}
};
var response = client.SendPush(pushPayload);
Console.WriteLine(response.Content);
} private static void ExecuteDeviceEample()
{
var registrationId = "";
var devicePayload = new DevicePayload
{
Alias = "alias1",
Mobile = "",
Tags = new Dictionary<string, object>
{
{ "add", new List<string>() { "tag1", "tag2" } },
{ "remove", new List<string>() { "tag3", "tag4" } }
}
};
var response = client.Device.UpdateDeviceInfo(registrationId, devicePayload);
Console.WriteLine(response.Content);
} private static void ExecuteReportExample()
{
var response = client.Report.GetMessageReport(new List<string> { "" });
Console.WriteLine(response.Content);
} private static void ExecuteScheduleExample()
{
var pushPayload = new PushPayload
{
Platform = "all",
Notification = new Notification
{
Alert = "Hello JPush"
}
};
var trigger = new Trigger
{
StartDate = "2017-08-03 12:00:00",
EndDate = "2017-12-30 12:00:00",
TriggerTime = "12:00:00",
TimeUnit = "week",
Frequency = ,
TimeList = new List<string>
{
"wed", "fri"
}
};
var response = client.Schedule.CreatePeriodicalScheduleTask("task1", pushPayload, trigger);
Console.WriteLine(response.Content);
}
}
}

C# 推送到极光的更多相关文章

  1. android推送,极光推送

    android中简单易用的消息推送方式之中的一个 -------> 极光推送 首先来介绍一下极光推送. 极光推送:英文简称 JPush,是一个面向普通开发人员免费.开放的第三方消息推送服务,我们 ...

  2. Android开发之第三方推送JPush极光推送知识点详解 学会集成第三方SDK推送

    作者:程序员小冰,CSDN博客:http://blog.csdn.net/qq_21376985 下面是一些知识点介绍,后期将会带领大家进行代码实战: 一.Android实现推送方式解决方案: 1.推 ...

  3. APP的消息推送(极光推送)

    APP的消息推送,使用的第三方平台是极光推送 简单案例(以Thinkphp为例): 1.下载下载PHPSDK 2.把PHPSDK目录下的jpush-api-php-client-3.5.1\src\J ...

  4. Android消息推送——JPush极光推送

    刚看了一篇关于Android消息推送评测总结的博客http://www.cnblogs.com/logan/p/4514635.html: 自己也对原学过的JPush极光进行一下小结,方便后续工作使用 ...

  5. iOS第三方推送-极光推送

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...

  6. iOS推送功能极光推送的介绍与实现

    1.个人整理操作流程 2.官方使用说明流程 2018iOS极光推送完整流程 极光推送官网

  7. xamarin.android 消息推送功能--极光推送

    最近在使用xamarin.android的消息推送功能,官方使用的例子是FCM方式,按照官方文档,使用FQ软件是可以成功的,但是在国内由于众所周知的原因,在国内服务并不能使用,于是查找国内各自推送平台 ...

  8. 【android极光推送】—从客户端到后台,一文通吃

    sion android:name="android.permission.VIBRATE" /> <uses-permission android:name=&quo ...

  9. 极光推送-Java后台实现方式一:Http API

    Java后台实现极光推送有两种方式,一种是使用极光推送官方提供的推送请求API:https://api.jpush.cn/v3/push,另一种则是使用官方提供的第三方Java APIjar包,这里先 ...

随机推荐

  1. Getting Private/Public IP address of EC2 instance using AWS-cli [closed]

    For private IP address: aws ec2 describe-instances --instance-ids i-b78a096f | grep PrivateIpAddress ...

  2. SpringMVC中ModelAndView addObject()设置的值jsp取不到的问题

    controller public class HelloWorldController implements Controller { public ModelAndView handleReque ...

  3. word2vec Explained: deriving Mikolov et al.'s negative-sampling word-embedding method

    最近接到任务研究word2vec,感觉网络上关于这个的资料层次不齐,总感觉解释的都没有那么完善.或许就连作者本人也不是非常清楚为什么他的模型好使.论文中提到的negtive sampling给了我很大 ...

  4. mysql 数据库备份与还原,用户的创建与删除,用户的密码修改

    1.备份数据库 要退出mysql rimideiMac-23:~ rimi$    mysqldump -u root -p pro >pro.sql ls 查看路径 2.恢复数据库 2.1直接 ...

  5. 【BZOJ1085】【SCOI2005】骑士精神 [A*搜索]

    骑士精神 Time Limit: 10 Sec  Memory Limit: 162 MB[Submit][Status][Discuss] Description 在一个5×5的棋盘上有12个白色的 ...

  6. 阿里云服务器下安装配置 vsftpd —— 基于CentOS 6.3 【简洁版】

    原文链接:http://www.tuicool.com/articles/nuiQBja 1.更新yum源 我是直接 yum update 更新的 2.安装vsftp 使用yum命令安装vsftpd ...

  7. E题hdu 1425 sort

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1425 sort Time Limit: 6000/1000 MS (Java/Others)    M ...

  8. 顺序图(Sequence Diagram)

    顺序图(Sequence Diagram): 是一种强调对象间消息传递次序的交互图,又称为时序图或序列图.描述了在一个用例或操作的执行过程中对象如何通过消息相互交互,说明了消息如何在对象之间被发送和接 ...

  9. 一个简单爬免费代理IP的脚本

  10. linux编程之信号量编程

    信号量当我们在多用户系统,多进程系统,或是两者混合的系统中使用线程操作编写程序时,我们经常会发现我们有段临界代码,在此处我们需要保证一个进程(或是一个线程的执行)需要排他的访问一个资源.信号量有一个复 ...