title: Apple Push Notifications from WebApi app
body: <p>I am using <a href="https://github.com/Redth/PushSharp" rel="nofollow">PushSharp</a> for Apple Push Notifications and it is working from console app and windows service on Windows 8 and Windows Server 2008R2, but the same code transferred to WebApi app on the same computers does not work. I've installed certificate and private key via mmc in Personal (the private key is available, granted permission for IIS_USRS) and Trusted Root Certificate Authorities.
  Code is kind of obvious, but just in case:</p>
  
  <pre><code>var push = PushBroker();
  var appleCert = File.ReadAllBytes("C:\Users\Documents\Certificates\Push.p12");
  push.RegisterAppleService(new PushSharp.Apple.ApplePushChannelSettings(false, appleCert, "pwd"));
  PushSharp.Apple.AppleNotification notif = new PushSharp.Apple.AppleNotification()
      .ForDeviceToken("xxx")
      .WithAlert("Updated...")
      .WithBadge(1)
      .WithSound("default");
  push.QueueNotification(notif);
  //Wait for queue to finish
  push.StopAllServices(true);
  </code></pre>
  
  <p>No errors/exceptions etc., its just the iPhone device does not get notifications when initiated in WebApi app.</p>