Pushsharp apple notification A call to SSPI failed error

后端 未结 1 1983
误落风尘
误落风尘 2021-01-20 17:59

I am using PushSharp to send Apple Push Notification in C# , i have my production .pem file and its password. Below is my code snippet.Am always getting this error ..

<
1条回答
  •  攒了一身酷
    2021-01-20 18:38

    I think your c# may be incorrect, To verify, rather than with a .pem, can you try with your p12 cert using the below code as a test...

        Boolean bsandbox = true;
        string p12fileName =AppDomain.CurrentDomain.BaseDirectory + "yourCert.p12";
        string p12password = "1234";
    
        string deviceID1 = "2909b25e0c699b2dc4864b4b9f719e67aac7e0fab791a72a086ffb788ba28f6a"; //
        string msg = "This is the message sent at : ";
        string alert = "Hello world at " + DateTime.Now.ToLongTimeString();
        int badge = 1;
        string soundstring = "default";
        var payload1 = new NotificationPayload(deviceID1, alert, badge, soundstring);
        payload1.AddCustom("custom1", msg); 
    
        var notificationList = new List { payload1 };
    
    
    
        var push = new PushNotification(bsandbox, p12fileName, p12password);
    
        var rejected = push.SendToApple(notificationList);`
    

    0 讨论(0)
提交回复
热议问题