Project Description
JPush.NET is JPush SDK for .NET. It can help you send, monitor and manage all your JPush messages by programming, following JPush official REST API.
Click here to view JPush official document.
This project contains following parts:
- Pure API client, following official REST API. You can download orreview documentation.
- ASP.NET MVC based Web Portal for basic operations and simple configuration. (Can be demo)
Sample:
Here is a sample based on .NET console application.
class Program { staticvoid Main(string[] args) { var appKey = "1234567890abcdef"; // Your App Key from JPushvar masterSecret = "1234567890abcdef"; // Your Master Secret from JPush Dictionary<string, string> customizedValues = new Dictionary<string, string>(); customizedValues.Add("CK1", "CV1"); customizedValues.Add("CK2", "CV2"); JPushClient client = new JPushClient(appKey, masterSecret, false); var response = client.SendPushMessage(new PushMessageRequest { MessageType = MessageType.Notification, Platform = PushPlatform.Android, Description = "DotNET", PushType = PushType.Broadcast, IsTestEnvironment = true, Message = new PushMessage { Content = "Hello, this is a test push from .NET. Have a nice day!", PushTitle = "A title.", Sound = "YourSound", CustomizedValue = customizedValues } }); Console.WriteLine(response.ResponseCode.ToString() + ":"+ response.ResponseMessage); Console.WriteLine("Push sent."); Console.WriteLine(response.ResponseCode.ToString() + ":"+ response.ResponseMessage); List<string> idToCheck = new List<string>(); idToCheck.Add(response.MessageId); var statusList = client.QueryPushMessageStatus(idToCheck); Console.WriteLine("Status track is completed."); if (statusList != null) { foreach (var one in statusList) { Console.WriteLine(string.Format("Id: {0}, Android: {1}, iOS: {2}", one.MessageId, one.AndroidDeliveredCount, one.ApplePushNotificationDeliveredCount)); } } Console.WriteLine("Press any key to exit."); Console.Read(); } } |
RESTful API reference: http://docs.jpush.cn/display/dev/Index
If you have any question or concern, you can contact
me.