Hi guys,
I need a way to test Push notification feedback service. I can send the notifications fine.
I installed the app using XCode to my dev IPod, sent push notifications just fine, the app received them ok.
I uninstalled the app, sent a few push notifications. Then tried the feedback service, but no luck. I do not receive any bytes back from the stream.
Even tried waiting for upto a day. Tried the same on a different iphone, but nothing. I am sure the code is fine, double checked the url and port etc, all fine. Besides using the same settings (apart from url and port) I can send the pushes just fine.
So I am not sure what to do now. I have searched on the web, but could not find anything useful. Someone suggested exactly what i have already tried (send push -> uninstall -> send push -> listen for feedback).
Any ideas? Any way ican make sure that its fine before pushing it live?
Below is the code (C#):
using (TcpClient client = new TcpClient())
{
client.Connect("feedback.sandbox.push.apple.com", 2196);
using (NetworkStream networkStream = client.GetStream())
{
Console.Out.WriteLine("Client Connected");
X509Certificate cert = new X509Certificate(fileLocation, password);
X509CertificateCollection certCollection = new X509CertificateCollection(new X509Certificate[1] { cert });
SslStream ssl = new SslStream(client.GetStream(), true, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
try
{
int bytesRead;
byte[] b = new byte[38];
ssl.AuthenticateAsClient("feedback.sandbox.push.apple.com", certCollection, SslProtocols.Default, false);
do
{
bytesRead = ssl.Read(b, 0, b.Length);
}
while (bytesRead != 0);
ssl.Close();
}
catch (AuthenticationException e)
{
Console.WriteLine("Exception: {0}", e.Message);
return;
}
}
}