Vote count:
0
I am working on apple push notification using Push Sharp. It's working good on my local machine with development and distribution certificates. I did receive push notification when i tried locally. But, When I moved the code to my production server (GODaddy server), I am receiving an error System.Security.Cryptography.CryptographicException).
PushBroker _pushBroker = new PushBroker(); var appleCert = File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Certificates/App_AdHoc.p12")); _pushBroker.RegisterAppleService(new ApplePushChannelSettings(true, appleCert, "pamten")); //Extension method _pushBroker.QueueNotification(new AppleNotification() .ForDeviceToken("Device Token") .WithAlert("Message") .WithBadge(0) .WithSound("default") );
Below is the error i am getting in GoDaddy server.
ExceptionType": "System.Security.Cryptography.CryptographicException", 5 "StackTrace": " at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)\r\n at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)\r\n at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)\r\n at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)\r\n at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)\r\n at PushSharp.Apple.ApplePushChannelSettings..ctor(Boolean production, Byte[] certificateData, String certificateFilePwd, Boolean disableCertificateCheck)\r\n at InStorePal.Controllers.InStorePalController.GetItemsList(GetItems obj)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.b__c(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.b__4()\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)" 6 }
I have tried lot of ways like access permissions for the folders in GODaddy server, created distributed certificates so many times.
Please help me. . .
Push Sharp ios notification getting error with distribution certificate "System.Security.Cryptography.CryptographicException"
Aucun commentaire:
Enregistrer un commentaire