0

This the code we are using for sending push notification to apple for updating apple wallet pass: we are using .net api service for sending push notification to apple.

var handler = new HttpClientHandler();
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
handler.ClientCertificates.Add(new X509Certificate2(X509Certificate2.CreateFromEncryptedPemFile("passcertificate.pem", "password", "passkey.pem").Export(X509ContentType.Pfx))); 

using (var httpClient = new HttpClient(handler))
{
    using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.push.apple.com/3/device/pushtoken"))
    {
        request.Headers.TryAddWithoutValidation("apns-topic", "pass.com.companyname.loyaltycard");
        request.Headers.TryAddWithoutValidation("apns-priority", "10"); 

        request.Content = new StringContent("{}");
        request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/x-www-form-urlencoded"); 

        var response = await httpClient.SendAsync(request);
    }
}

Above push notification call is returning status 200: and no error is retuned in response.

But our web API is not being called by Apple server for getting updated serial number:

webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=date

Please help me in identifying what could be possibly wrong.

1 Answers1

0

I have managed to solve the issue - my passTypeIdentifier contains(.), that's why my web api was not being called from apple server. thanks to below post.. https://stackoverflow.com/a/37080463/3556270

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 17 '23 at 19:26