zoukankan      html  css  js  c++  java
  • .net core 集成极光推送

    登录极光推送 

    创建应用

    appkey和master secret在推送时会使用

    设置推送

    使用手机扫描二维码安装apk

    下载dll

    测试

    using Jiguang.JPush;
    using Jiguang.JPush.Model;
    using System;
    using System.Collections.Generic;
    
    namespace JpushExample
    {
        class Program
        {
            private static JPushClient client = new JPushClient("appKey", "masterSecret");
            static void Main(string[] args)
            {
                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);
                Console.WriteLine("Hello World!");
                Console.Read();
            }
    

      

  • 相关阅读:
    Codeforces Round #436 (Div. 2)
    【bzoj1090】 [SCOI2003]字符串折叠
    【并查集】食物链(带权并查集)
    【图论】二分图
    【图论】关押罪犯
    关于图论的若干巴拉巴拉
    一系列的入门and一堆吐槽
    【分块】八
    9-30刷题记录
    bzoj5055
  • 原文地址:https://www.cnblogs.com/Justsoso-WYH/p/10550582.html
Copyright © 2011-2022 走看看