c# - APNS APPLE C# sslstream 响应

标签 c# iphone apple-push-notifications apns-sharp

我想将 Apple 的 APNS 与 c# 服务结合使用。该服务运行完美。 如果将平底锅发送给苹果,我想要的是苹果的反馈。 所以我需要的是来自 sslstream 的反馈。

任何人都可以帮助我并告诉我如何从 sslstream 中的服务器获得反馈吗?

提前致谢

这是我如何将平底锅发送到苹果服务器的代码:

    TcpClient client = new TcpClient(hostname, APNS_PORT);
    SslStream sslStream = new SslStream(
        client.GetStream(),
        false,
        new RemoteCertificateValidationCallback(ValidateServerCertificate),
        null
        );

     sslStream.AuthenticateAsClient(hostname, certificatesCollection, SslProtocols.Tls, true);

     sslStream.Write(array);
     sslStream.Flush();

最佳答案

从这个苹果链接: http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html

If you send a notification and APNs finds the notification malformed or otherwise unintelligible, it returns an error-response packet prior to disconnecting. (If there is no error, APNs doesn’t return anything.) Figure 5-3 depicts the format of the error-response packet.

我假设您刚刚从流中读回,但我自己还没有让它工作。 我试图发送格式错误的请求以响应数据包,但是我的读取调用被阻止,似乎在等待 ANPS 响应。

关于c# - APNS APPLE C# sslstream 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9223704/

相关文章:

iphone - 无法在 UIImageView 中加载 2 个单独的图像序列

iphone - Cocoa touch - UIAnimation问题

iphone - 如何确定设置是否存储在iOS的应用程序中?

firebase - iOS 离线时的 FCM 行为

iphone - iOS-Apple 推送通知从 APNS 重新发送

c# - 如何使用 CaSTLe Windsor 通过 WPF 应用程序实现正确的 Di

c# - 我怎么能够创建接口(interface) Microsoft.Office.Interop.Word.Application 的新实例

c# - 使用 jQuery 回发到 Controller

ios - Grails:在生产中的网络应用程序上查找文件

c# - 从指数表示法解析数字