El mensaje push no se envía con un certificado distribuido

Puedo enviar notificaciones push con el archivo p12 del desarrollador usando sandbox, pero mi aplicación en la tienda de aplicaciones, uso el archivo de certificado de distribución f12 usando los mensajes gateway.push.apple.com no puede llegar a los dispositivos.

El servicio de notificaciones push está activado en el certificado de destilación, verifiqué en developer.apple.com, también estoy probando una nueva identificación de dispositivo (no ID del dispositivo desarrollador)

¿Como puedo resolver mi problema? ¿Usted me podría ayudar? ¿Dónde está mi error?

Mi código C # como a continuación:

int puerto = 2195;

    String hostname = "gateway.push.apple.com";

    String certificatePath = HttpContext.Current.Server.MapPath("distribution.p12");


    X509Certificate2 clientCertificate = new X509Certificate2(System.IO.File.ReadAllBytes(certificatePath), "xxx", X509KeyStorageFlags.MachineKeySet |
    X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);

    X509Certificate2Collection certificatesCollection = new X509Certificate2Collection(clientCertificate);
    TcpClient client = new TcpClient(hostname, port);
    SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
    try
    {
        sslStream.AuthenticateAsClient(hostname, certificatesCollection, SslProtocols.Tls, true);
    }
    catch (Exception e)
    {
        throw (e);
        client.Close();
        return;
    }
    MemoryStream memoryStream = new MemoryStream();
    BinaryWriter writer = new BinaryWriter(memoryStream);
    writer.Write((byte)0); 
    writer.Write((byte)0);  //The first byte of the deviceId length (big-endian first byte)
    writer.Write((byte)32); //The deviceId length (big-endian second byte)
    //String deviceID = "f1430c99 910d292d 2f756294 f2f6b348 153bc215 d5404447 16b294eb fdb9496c";
    writer.Write(HexStringToByteArray(deviceID.ToUpper()));
    String payload = "{\"aps\":{\"alert\":\"" + Mesaj + "\",\"badge\":0,\"sound\":\"default\"}}";
    writer.Write((byte)0);
    writer.Write((byte)payload.Length);
    byte[] b1 = System.Text.Encoding.UTF8.GetBytes(payload);
    writer.Write(b1);
    writer.Flush();
    byte[] array = memoryStream.ToArray();
    sslStream.Write(array);
    sslStream.Flush();
    client.Close();

Respuestas a la pregunta(0)

Su respuesta a la pregunta