2013-05-03 56 views
0

我已经下载了库Push Sharp,并通过源代码检查,我无法弄清楚如何开始发送​​notifricatinos到APN。PushSharp库并发送通知到APN

正如他们的文档中给出的,我配置了Apple的证书。但图书馆太复杂,无法确定从哪里开始。即使这个项目在我的VS2010中加载了很多错误。这与VS2010有关吗?

有人可以请我指向一个初学者级别的资源,这将有助于我开始使用Push Sharp。最近几天我脱掉了头发。希望有人能够帮助我。

+0

推式#[文档】(https://github.com/Redth/PushSharp/blob/master/Documentation/)排序的[具有示例]( https://github.com/Redth/PushSharp/blob/master/Documentation/APNS-Guide-Images/apns-guide-022.png)。 – bzlm 2013-09-22 20:08:55

回答

4

不知道如果你还在寻找,但这个(希望)似乎是几乎正是你在找什么:Send push notifications to iPhone with PushSharp, C#, MonoTouch, client-side and server-side

代码摘录:

_pushBroker = new PushBroker(); 
var appleCert = File.ReadAllBytes("PushSharp.PushCert.Development.p12"); 
_pushBroker.RegisterAppleService(
    new ApplePushChannelSettings(false, appleCert, "ThePassword")); 
_pushBroker.QueueNotification(
    new AppleNotification() 
    .ForDeviceToken(deviceToken) 
    .WithAlert(message) 
    .WithBadge(1) 
    .WithSound("sound.caf")); 
+1

请注意,只提供链接的答案是不鼓励的,所以答案应该是搜索解决方案的终点(而另一个引用的中途停留时间往往会过时)。请考虑在此添加独立的摘要,并将链接保留为参考。 – kleopatra 2013-08-02 15:05:13

+1

@kleopatra,我添加了代码摘录。 – bzlm 2013-09-22 20:03:58