I am trying to set up apple push notifications, i am writing my own code for the server and as far as i know i have set up the app correctly. How ever i keep getting the following error come back from the log:
Payload queue received. Connecting to apple server. Creating SSL connection. Conected. Payload generated for "Token goes here i deleted it : {"aps":{"alert":"test","badge":1,"sound":"default"}} Notification successfully sent to APNS server for Device Toekn : "Token here I've deleted it" An error occurred while reading Apple response for token "Token here I've deleted it" - Input string was not in a correct format. Disconnected
This is my code.
var push = new PushNotification(true, @"C:\wwwroot\UltraNet\PushService\bin\Debug\206dist.p12", "ultrait");
var payload = new NotificationPayload("devicetoken here ive deleted it", "test", 1, "default");
var p = new List<NotificationPayload> { payload };
var result = push.SendToApple(p);
Console.ReadLine();
I have made sure that the certificates etc are set up correctly.
I am testing it as a adhoc app at the moment because it takes so long for a new version to be able to go live.
I really don't know where I'm going wrong if any one could help it would be brilliant thank you.
I also don't know what i need to do with the PEM files that i have created.
Edit***
I have the correct token this is another error that i receive
Payload generated for df99286a1cb993cecba86b2e21f3fc4c04d214fcf7e0cf35a668fc822bdaa053 : {"aps":{"alert":"test","badge":1,"sound":"default"}} Notification successfully sent to APNS server for Device Toekn : df99286a1cb993cecba86b2e21f3fc4c04d214fcf7e0cf35a668fc822bdaa053 Disconnected. An error occurred while reading Apple response for token df99286a1cb993cecba86b2e21f3fc4c04d214fcf7e0cf35a668fc822bdaa053 - Safe handle has been closed
It was all to do with my certificates. Because i hadn't turnt my combined PEM certificate back to a p12 file.