In doing. NET to the iOS device app for a message push, using the Pushsharp Open source class library for message push, and in the development process, using a beta version of the app, The P12 certificate used is the ApnsConfiguration.ApnsServerEnvironment.Sandbox mode, and after the project is released, now use the release of the certificate to push, found that can not push success, finally found in the use of Pushsharp to send The ApnsConfiguration.ApnsServerEnvironment.Production mode is used for the push of the post-cloth item. In order to push successfully.
You should use the production parameter instead of sandbox sandbox mode when instantiating the Apnsconfiguration object.
The code is as follows:
Apnsconfiguration apnsconfig=new apnsconfiguration (ApnsConfiguration.ApnsServerEnvironment.Production, "certificate. P12", " Certificate Password ");//sandbox sand Box
After you modify the parameters, you use the published version of the certificate and password to complete the push task.