OGeek|极客世界-中国程序员成长平台

标题: C# 月亮 APNS : iOS Device Did Not Receive Notification [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 14:01
标题: C# 月亮 APNS : iOS Device Did Not Receive Notification

我是 iOS 开发的新手。最近,我尝试使用 moon-APNS 向我的设备发送推送通知。我遵循 arashnorouzi.wordpress.com 中的每一步。当我运行我的程序并阅读日志时,通知已成功发送到 APNS 服务器,但我从未在我的设备上收到通知。什么可能是错的?我应该在我的设备或 iOS 应用程序上进行一些设置吗?我只在示例代码中更改了设备 token 、证书路径、密码。这是我的代码:

        var payload1 = new NotificationPayload("b8bf91fcc66016a7bf96154f3c65c6c479385df98094394c2514682152c29968", "Message", 1, "default");
        payload1.AddCustom("RegionID", "IDQ10150");

        var p = new List<NotificationPayload> {payload1};

        var push = new PushNotification(false, "D:\\certificate\\aps_development.p12","aswin123");
        var rejected = push.SendToApple(p);
        foreach (var item in rejected)
        {
            Console.WriteLine(item);
        }
        Console.ReadLine();

有人可以帮助我吗?非常感谢您的回答。



Best Answer-推荐答案


检查您是否这样做:

在 appID 中为您的应用启用推送通知 检查,您在运行应用程序时是否获得 token

关于C# 月亮 APNS : iOS Device Did Not Receive Notification,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10942545/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4