So the other day my boss asked me to implement a few Azure Push Notifications related Web methods in one of our ASP Web API projects I had developed. Those Web methods were suppose to send Push Notification messages to the Azure Notification Hub, where as those notifications will be delivered to the User’s mobile devices.
When I started implementing I realized when calling the Azure Notification Hub using the Windows Azure Library, I realized there’s only Asynchronous calls available to communicate with the Notification Hub. It got me thinking, How on earth am I gonna call Asynchronous methods inside the ASP Web API (as I haven’t tried that before). Well, after a little bit of playing around I figured it out thanks to some documentations in ASP.NET website.
So here I am sharing the code I used for you all, if you ever come across such an implementation, how to call an Asynchronous methods inside the ASP Web API.
Have fun Coding fellas !😀