How to make push notification for i-pad on windows azure

I have an MVC Web API project and I need to send a push notification to the iPad. I used .cer and .p12 files for this and it works fine. Now I need to publish it on the azure server, but I'm new to azure and don't know where to store it and how to access the certificate.

I tried to upload the certificate to the cloud service, but could not get it.

I am using the following code:

string strDeviceToken = "abcd";
string strPushMessage = "hello";
var payload1 = new NotificationPayload(strDeviceToken, strPushMessage, 1, "default");
payload1.AddCustom("RegionID", "IDQ10150");
var p = new List<NotificationPayload> { payload1 };
var push = new PushNotification(true, certificatePath, "password");
string strfilename = push.P12File;
var message1 = push.SendToApple(p);
+4
source share
1 answer

,   http://www.c-sharpcorner.com/UploadFile/pandeypradip/apple-push-notification-using-Asp-Net/ Attech Dll

  • string strDeviceToken = "xyz"
  • string strPushMessage = "test"
  • payload1.AddCustom( "RegionID", "IDQ10150" );
  • var p = new List {payload1};
  • string certificatePath = System.Web.HttpContext.Current.Server.MapPath( "~/App_Data/certificates/xyz.p12" );
  • var push = new PushNotification (true, certificatePath, "password" );
  • string strfilename = push.P12File;
  • var message1 = push.SendToApple(p);
0

Source: https://habr.com/ru/post/1538832/


All Articles