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. Android之极光推送发送自定义消息

    Android端实现主要代码: <span style="font-size:14px;">import java.io.IOException; import jav ...

  2. [USACO06NOV] Roadblocks

    https://www.luogu.org/problem/show?pid=2865 题目描述 Bessie has moved to a small farm and sometimes enjo ...

  3. CodeForces 316D3 PE Lesson

    time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standa ...

  4. UIControl事件---iOS-Apple苹果官方文档翻译

    本系列所有开发文档翻译链接地址: iOS7开发-Apple苹果iPhone开发Xcode官方文档翻译PDF下载地址 UIControl事件1.UIControlEventTouchDown单点触摸按下 ...

  5. 【洛谷 P2754】 [CTSC1999]家园(最大流)

    题目链接 突然发现Dinic很好写诶.. 第一次数组开小了,玄学\(WA\),what?数据范围描述有误? 分层图,每天为一层. 把上一天的每个空间站向这一天连一条流量为inf的边,表示可以原地不动. ...

  6. 计蒜客 Goldbach Miller_Rabin判别法(大素数判别法)

    题目链接:https://nanti.jisuanke.com/t/25985 题目: Description: Goldbach's conjecture is one of the oldest ...

  7. vim 实现括号以及引号的自动补全

    编辑文件/etc/vim/vimrc sudo vim /etc/vim/vimrc 在最后添加 inoremap ( ()<ESC>i inoremap [ []<ESC>i ...

  8. python之提速千倍爆破一句话

    看了一下冰河大佬写的文章特别有感:https://bbs.ichunqiu.com/thread-16952-1-1.html 简单描述一下: 利用传统的单数据提交模式. 比如下面这个一句话木马: & ...

  9. Python3 面向对象编程高级语法

    1.静态方法: #!/usr/bin/env python # _*_ coding:utf-8 _*_ # Author:CarsonLi class Dog(object): def __init ...

  10. 006 Java并发编程wait、notify、notifyAll和Condition

    原文https://www.cnblogs.com/dolphin0520/p/3920385.html#4182690 Java并发编程:线程间协作的两种方式:wait.notify.notifyA ...