zoukankan      html  css  js  c++  java
  • 移动消息推送库 PushSharp

    PushSharp 实现了服务器端向移动客户端推送消息的库,支持 iOS (iPhone/iPad APNS), Android (C2DM and GCM - Google Cloud Message), Windows Phone, 和  Windows 8 devices!

    示例代码:

    01 //Create our push services broker
    02 var push = new PushBroker();
    03  
    04 //Registering the Apple Service and sending an iOS Notification
    05 var appleCert = File.ReadAllBytes("ApnsSandboxCert.p12"));
    06 push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "pwd"));
    07 push.QueueNotification(new AppleNotification()
    08                            .ForDeviceToken("DEVICE TOKEN HERE")
    09                            .WithAlert("Hello World!")
    10                            .WithBadge(7)
    11                            .WithSound("sound.caf"));
    12  
    13  
    14 //Registering the GCM Service and sending an Android Notification
    15 push.RegisterGcmService(new GcmPushChannelSettings("theauthorizationtokenhere"));
    16 //Fluent construction of an Android GCM Notification
    17 //IMPORTANT: For Android you MUST use your own RegistrationId here that gets generated within your Android app itself!
    18 push.QueueNotification(new GcmNotification().ForDeviceRegistrationId("DEVICE REGISTRATION ID HERE")
    19                       .WithJson("{\"alert\":\"Hello World!\",\"badge\":7,\"sound\":\"sound.
  • 相关阅读:
    odoo字段
    页签中加按钮 odoo里面
    页签类型按钮上面记录条数获得
    sql语句 这里是取一串数据中的 头 中 尾 几个数据
    python 字典,元组,对象,数组取值方法
    action类型的按钮和object按钮的用法
    数据结构与算法 基于c语言篇
    odoo开发历史订单需求整体思路
    spring框架的ioc和aop
    java注解和反射学习
  • 原文地址:https://www.cnblogs.com/kuaidianba/p/2989151.html
Copyright © 2011-2022 走看看