在 asp.net c# 中创建 iPhone 推送通知 Web 服务
有谁知道如何在 asp.net (C#) 中创建可以使用 JSON 协议调用的 iPhone 推送通知 Web 服务的步骤?我希望能够通过 http 请求将警报发送到另一个 iphone 设备 ID。这可能吗?任何示例代码都会有所帮助。
Does anyone know the stepts how to create an iPhone push notifcation web service in asp.net (C#) that I can call using JSON protocol? I'd like to be able to an http request to have an alert sent to another iphone device id. Is this possible? Any sample code would be helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iPhone 3.0 及更高版本支持通过 Apple 服务器推送通知,请参阅 SDK。我建议您确实使用该技术,因为它允许您的应用程序在不运行时接收消息,并且不会导致比您的 iPhone 消耗更多的电池电量。
此外,正如 Rex M 上面已经提到的,Web 服务不支持开箱即用的推送技术。 Microsoft Exchange 使用的一种通过 Web 服务进行推送的方法是:发出服务器调用,然后让服务器阻塞(即不回复),直到服务器为客户端提供更新。因此:
在这种模型中,客户端需要保护服务器和客户端之间的连接。如果由于任何原因断开,客户端需要启动一个新的连接。连接被丢弃的一个原因是中间的防火墙超时,甚至可能是 IIS 超时。
iPhone 3.0 and higher supports push notification via Apple's server, see SDK. I'd suggest you do use that technology, as that allows your app to receive messages while not running and does not result in using more batrery power than your iphone already does.
Further, as Rex M already mentioned above, Web services does not support push-technology out of the box. A way to do push over web services is what Microsoft exchange uses: to make a server call, and then to have the server block (i.e. not answer back) until the server has an update for the client. So:
In this model, the client needs to guard the connection between the server and the client. If for any reason dropped, the client need to start a new connection. A reason for the connection being dropped, would be that the firewall in the middle times out or may be even IIS times out.