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.