1
votes

I'm using Azure Notification Hubs with my iOS app. Initially I was using sandbox mode in for testing in the hub and it was worked. After releasing app push notifications are not receiving. Then I changed the push notification certificate to production & uploaded a new .p12 file to the hub and tested but again it worked for sandbox but not for production mode.

Do i have to release the app to make sure new certificate is working for production mode?

2
Are you using the right production apns api?lubilis
@lubilis what do you mean by APNS Api? is that azure Endpoints(Connection string) ?.Anushka Madushan
Yes, there should be a development endpoint and a production endpointlubilis
@lubilis how can i find out development endpoint and a production endpoints separately.There are two endpoints like DefaultListenSharedAccessSignature and DefaultFullSharedAccessSignature. I'm using DefaultListenSharedAccessSignature in my app.Anushka Madushan
Sorry i don't use Azure, but i suppose there should be something different between development and production push service. Maybe an attribute to set dynamically in SDK or a different url; changing certificates could be not enoughlubilis

2 Answers

1
votes

Are you using the same hub or two different hubs with sandbox and production certificates? According to Azure Notification Hubs troubleshooting guide you must use two separate ones:

Apple Push Notification Service (APNS) configuration

You must maintain two different hubs - one for production and another for testing purpose. This means uploading the certificate you are going to use in sandbox environment to a separate hub and the certificate you are going to use in production to a separate hub. Do not try to upload different types of certificates to the same hub as it may cause notification failures down the line. If you do find yourself in a position where you have inadvertently uploaded different types of certificate to the same hub, it is recommended to delete the hub and start fresh. If for some reason, you are not able to delete the hub then at the very least, you must delete all the existing registrations from the hub.

Also, see there's a detailed step-by-step guide for developing iOS apps with Azure Notification Hubs. Take a look at how they set up certificates there, it should work.

If neither of these helps, please mention in the comments where does it still fail.

0
votes

I experience the same issue. I set up an Azure Notification Hub in "sandbox" mode. The testing went well and notifications were received on the test devices. I switched to "production" mode and uploaded the .p12 certificate.

I did a test immediately and although the notification was logged as successful - nothing was received on the device. I was at the point of deleting the hub as suggested and starting again, until I decided to send one more test message - and it worked without having changed anything.

My guess is that it takes some time for changes from sandbox to production to resolve. As a new Xamarin iOS developer I have learnt that sometimes patience fixes a lot of things.