I am new to .net coding. Right now I am trying to implement Moon apns to send notifications to one of my iphone application. When I run the application locally (with out hosting) it is working fine and I am able to send push notifications to ios app. I cross checked it and working great. But after hosting it in a server (which has no firewalls) I am getting the following error. I am unable to understand what's the wrong I did. My code is as follows and I got exception like "Array may not be empty or null. Parameter name: rawData"
Code:
string message = string.Format("{0} has sent you a text chirp", username);
var payload1 = new NotificationPayload(token, message, int.Parse(badgeNumber), "default");
payload1.AddCustom("MessageType", "MessageTypeText");
payload1.AddCustom("Sender", toFbID);
payload1.AddCustom("AlertMessage", message);
payload1.AddCustom("MessageID", msgid);
var p = new List<NotificationPayload> { payload1 };
push = new PushNotification(true, "aps_development.p12", "chrip");
var rejected = push.SendToApple(p);
foreach (var item in rejected)
{
contxt.Response.Write(item);
}
Can anyone help on this? I tried with development and production p12 files but no use.
Edit:
Log info:
20130923 1538 - Info - Payload queue received.
20130923 1538 - Info - Connecting to apple server.
20130923 1538 - Info - Creating SSL connection.
20130923 1538 - Info - Conected.
20130923 1538 - Error - An error occurred while reading Apple response for token fb8a5834e2921f717ac83ce4ecdfd651922bbf81340bc133776bd55772fe6269 - Input string was not in a correct format.
20130923 1538 - Info - Payload generated for fb8a5834e2921f717ac83ce4ecdfd651922bbf81340bc133776bd55772fe6269 : {"aps":{"alert":"hiiiiiiiiiii","badge":123}}
20130923 1538 - Info - Notification successfully sent to APNS server for Device Toekn : fb8a5834e2921f717ac83ce4ecdfd789452bbf81340bc133776bd55772fe6269
20130923 1538 - Info - Disconnected.
Thank you, Chandra.