iOS Push Notification - not working in production

Ika777Ika777 ✭✭Member ✭✭

Hi All,
I was able to test push notifications in development but it is not working in production mode. Steps I've done are below:
1. I already had App ID, clicked edit and created certificate under push notifications:


2. Here is my production Apple Push Service certificate, downloaded it and double clicked it, it showed up in Keychain-> Exported certificate: saved .p12 file:

3. Re - downloaded production provisioning profile and double clicked on it. Push notifications are enabled in provisioning profile.

4. Changed Entitlement.plist enviroment to production:

5. In Visual Studio changed bundle id in Info.plist and set signing Id to distribution and set production provisioning profile. Rebuiled project and uplaoded .IPA file to iTunesConnect and distributed it using TestFlight.
Not getting any push notifications. Please help what am I doing wrong or missing?

Best Answer

Answers

  • Ika777Ika777 ✭✭ Member ✭✭

    @CodeSensei Thank you!!! I had to change my WebConfig file to point to prod certificate and change ApnsEnvironment to productions. :)

  • Cdn_EuroCdn_Euro ✭✭✭ Member ✭✭✭
    edited November 2018

    @Ika777 I am having the same problem. How do you change the WebConfig file to point to production certificate please? And you mean the webconfig file of the WebApi obviously right?

  • Ika777Ika777 ✭✭ Member ✭✭
    edited November 2018

    @Cdn_Euro Sorry for late response. Yes webconfig for WebAPI. Changed:
    <add key="ApnsEnvironment" value="sandbox" />to <add key="ApnsEnvironment" value="production" />
    <add key="iOSNotificationCertificateFile" value="xxx.p12" /> point to production certificate
    <add key="certificatePassword" value="xxx" /> production certificate password.

  • Cdn_EuroCdn_Euro ✭✭✭ Member ✭✭✭

    @Ika777 Thank you for that, it is good information. My push notifications in production work even without me adding that in the Web API. Now I wonder if I should leave it if it works or add that anyway.....

Sign In or Register to comment.