Tuesday 27 May 2014

Sending Apple Push Notifications in ASP.NET and C# (APNS Certificates Registration on Windows)

Hello Friends,

This Post will focus on How we can send an Apple Push Notification using ASP.NET and C#.

For more video tutorial You can Visit
http://YouTube.com/WebBoostings
Visit our WebSite
http://programming-guru.com

Before start, we need some certificate so please get all required certificates.
1) PushNotification.cer (Download from Apple Account)
2) PushNotification.p12 (Exported from Apple Key Chain) 

The certificates will get one from Apple Account and other from KeyChain Access of you MAC System.

Open Microsoft Management Console



To do this press Windows + R keys at the same time to open Run. Type ‘mmc’ and press enter.

This should open Following window on your screen:



Add Certificates Snap-in to your console


Click on file and select Add/Remove snap-in from menu. This will open a new window with a list of available snap-ins on the left .
Select Certificates form list on the left and hit Add button. 
Select Computer Account form the next prompt, Local computer form next one and click on finish. Your Add snap-in window should look like this:





And when you click ok button you will see :



Certificate installation


Click on Certificates(local Computer) to expand the list. Right click on personal, then select all tasks and click on import. This will open Certificate import wizard.

Click on next ,and select your .cer file in next step. In next step select second option to place all certificates in Personal store.

Press finish and you should see a confirmation message about successful installation on Certificate.

Repeat above step to import your .P12 file, now Expand Personal on left side and click on certificates. You should be able to see your certificate in right panel. If your .p12 is password protected , you need to enter the password in the wizard.

Repeat all import process to import your certificate and .p12 files to "Trusted Root Certification Authorities" Section.

Now you have imported required certificates to sign your APNS messages to Apple push notification server.




Now Import both the certification in Trusted Root Certificate Authority



That’s done for extra work Now just to Coding side.

Now, We have some Library to send Apple Push Notification on Device.
So, You can download that Library from this Link:


or You can go for Google with Mono-APN. You will get these files.




You have to please your Device Code, Message, Badge No, any Audio file name which is alredy available in iOS app.




Before build this C# Application you have to paste the Certification.p12 file in the bin/Debug directory after that you can send the Apple Push Notification to your device.


That's it. Now, you can run this application and within a movement you will get the nice Apple Push Notification on your own device.

For More video tutorial watch and subscribe

and visit our webSite



Thank You
Abhishek Bendre

No comments:

Post a Comment