0

我已经下载了库Push Sharp并检查了源代码,但我不知道如何开始向 APN 发送通知。

正如他们的文档中给出的那样,我已经配置了 Apple 的证书。但是图书馆太复杂了,不知道从哪里开始。甚至该项目在我的 VS2010 中也加载了很多错误。和VS2010有关系吗?

有人可以向我指出一个初学者级别的资源,这将帮助我开始使用 Push Sharp。这两天一直在脱头发。希望有人能够帮助我。

4

2 回答 2

4

不确定您是否还在寻找,但这(希望)似乎几乎正是您正在寻找的东西:使用 PushSharp、C#、MonoTouch、客户端和服务器端向 iPhone 发送推送通知

代码摘录:

_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"));
于 2013-08-02T14:16:47.567 回答
2

对于初学者级别,最好使用以下链接启动:

http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12

于 2013-05-03T06:04:27.397 回答