title: IOS Push notification using Pushsharp in c#
body: <p>i have developed code for push notification in ios in c# but it is not sending notification in mobile.
  I have used pushsharp library.</p>
  
  <p>My code is as followed:</p>
  
  <pre><code>PushNotificationApple pushNotification = new PushNotificationApple();
  pushNotification.SendNotification(postData);
  </code></pre>
  
  <p>My PushNotificationApple constructor code is as below:-</p>
  
  <pre><code>public PushNotificationApple()
          {
              if (_pushBroker == null)
              {
                  //Create our push services broker
                  _pushBroker = new PushBroker();
  
                  //Wire up the events for all the services that the broker registers
                  _pushBroker.OnNotificationSent += NotificationSent;
                  _pushBroker.OnChannelException += ChannelException;
                  _pushBroker.OnServiceException += ServiceException;
                  _pushBroker.OnNotificationFailed += NotificationFailed;
                  _pushBroker.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
                  _pushBroker.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
                  _pushBroker.OnChannelCreated += ChannelCreated;
                  _pushBroker.OnChannelDestroyed += ChannelDestroyed;
  
  
                  var appleCert = File.ReadAllBytes(System.Web.Hosting.HostingEnvironment.MapPath("~/Certificates" + ConfigSettings.SnaptymAPNSCertificate));
  
  
                  _pushBroker.RegisterAppleService(new ApplePushChannelSettings(false, appleCert,ConfigSettings.SnaptymAPNSPassword)); //Extension method                
              }
          }
  </code></pre>
  
  <p>My SendNotification function is as below:- </p>
  
  <pre><code>public bool SendNotification(GcmNotificationPostDataModel postData)
          {
  
              if (_pushBroker != null)
              {
                  foreach (var registrationId in postData.RegistrationIds)
                  {
  
                      _pushBroker.QueueNotification(new AppleNotification()
                                                  .ForDeviceToken(registrationId) //the recipient device id
                                                  .WithAlert(postData.Data.Message) //the message
                                                  .WithBadge(1)
                                                  .WithSound("sound.caf"));
  
                  }
              }
  
              return true;
          }
  </code></pre>