My app was getting push notification when I used Enterprise account with following push notification certificate in production environment:
Apple Production iOS Push Services
Then in order to publish my app in App store, I started using app store account, no matter what I try, apple creates production certificate in following name:
Apple Push Services
Then from this SO, I came to know that Apple has changed its naming in certificate. My issue is, I am using Push Sharp in server side and getting below error:
You have selected the Production server, yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!
Both the solution given in that not working.
I updated Push Sharp from 2.2 to 3.0 beta, got many compile errors, even PushSharp class itself doesn't exist, then tried another solution from that thread.
Downloaded PushSharp from this and recompiled it by removing production line, still getting same error. Also that solution was not clear that much, I am not sure whether to comment certificate check line or what, I tried all but no luck
How to fix this?
My dirty quick fix was to download the source code for PushSharp v2.2 and then in the file
ApplePushChannelSettings.cs
I commented out the check about production and test certificates:And replaced the PushSharp.Apple.dll file in my project.
Hopefully my customer will upgrade to dotnet 4.5 so we can use PushSharp 4 and do it the correct way.
You can start using the new PushSharp 3.0.1 stable version it's really simple and awesome.
First you should goto and remove all the pushsharp 2 related dlls:
and etc also make sure to remove:
Then goto your project and open nuget manager then search for latest stable version of PushSharp 3 nd download it.
Now you should use a new Pushsharp 3 APIs it's little different but more simpler so:
First create a class that contains all the brokers you want:
Then on you business logic / Controller / ViewModel etc. you will need to write your PushNotification Business:
Important notes:
Some times specially when you works with IIS you can find an exceptions related to IOS certificate and the most common one:
This was due to many reasons for example your app pool user privilege or the certificate installed on the user account instead of local machine so try to disable the impersonation authentication from iis also check that it's really helpful Apple PushNotification and IIS