Post

Replies

Boosts

Views

Activity

Reply to api.sandbox.push.apple.com:443 & api.push.apple.com:443 Push notification not receiving
We have a class library with the .Net framework (v4.5) and below is the source code to request the apns X509Certificate2 clientCertificate = new X509Certificate2(System.IO.File.ReadAllBytes(certificatePath), "XXX"); X509Certificate2Collection certificatesCollection = new X509Certificate2Collection(clientCertificate); String payload = string.Empty; SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null); Dictionarystring, string SOSdata = new Dictionarystring, string(); sslStream.AuthenticateAsClient(hostname, certificatesCollection, SslProtocols.Tls12, false); MemoryStream memoryStream = new MemoryStream(); payload = "{"aps":{"alert":"Testing.. (0)","badge":1,"sound":"default"}}"; byte[] payload1 = GeneratePayload(deviceID, payload, memoryStream); sslStream.Write(payload1); //ReadMessageAsync(sslStream, payload, payload1, deviceID); sslStream.Flush(); client.Close();
Mar ’21