title: NotifcationHub Messaging Not Working in my Xamarin iOS App
body: <p>Everything looks properly configured. I've gone over it many times. Here's what I got:</p>
  
  <p>Service Bus Explorer returns this when I connect:</p>
  
  <pre><code>    &lt;23:36:44&gt; The application is now connected to the 
  
  sb://localesnotify.servicebus.windows.net/ service bus namespace.
  &lt;23:36:44&gt; MessagingFactory successfully created
  &lt;23:37:24&gt; Exception: The remote server returned an error: (500) Internal Server Error. TrackingId:20b6388b-2599-428a-a7b8-2c81eba6b309,TimeStamp:3/4/2017 4:37:24 AM
  &lt;23:37:24&gt; InnerException: The remote server returned an error: (500) Internal Server Error
  </code></pre>
  
  <p>In all cases, when I test on my device, RegisteredForRemoteNotifications return successfully.</p>
  
  <pre><code>public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
      {
          Hub = new SBNotificationHub(Constants.ConnectionString, Constants.NotificationHubPath);
  
          Hub.UnregisterAllAsync(deviceToken, (error) =&gt; {
              if (error != null)
              {
                  Console.WriteLine("Error calling Unregister: {0}", error.ToString());
                  return;
              }
  
              NSSet tags = null; // create tags if you want
              Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback) =&gt; {
                  if (errorCallback != null)
                      Console.WriteLine("RegisterNativeAsync error: " + errorCallback.ToString());
              });
          });
  
          var alert = new UIAlertView("Remote Notifications", "Registered!", null, "OK", null);
  
          alert.Show();
      }
  </code></pre>
  
  <p>My certificates and provisioning profiles seem properly configured on both Azure &amp; Xamarin.</p>
  
  <p>I've tried different connection strings and notification hub urls. Not sure exaclty which ones to use. But I tried all I think.</p>
  
  <pre><code>// Azure app-specific connection string and hub path
      public const string ConnectionString = "Endpoint=sb://localesnotify.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=1QMNeVitGRUxoZvkgnx8klpJGsJ5LfX/057jL+CD2VE=";
      public const string NotificationHubPath = "sb://localesnotify.servicebus.windows.net";
  </code></pre>
  
  <p>When I test send from Azure, it says completed successfully but I never get the message. </p>
  
  <p>My ReceivedRemoteNotification does not fire off. So I guess my client is not properly connected. Also in Classic portal it says No registrations were found for the selected platform.</p>
  
  <pre><code>        public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
      {
          ProcessNotification(userInfo, false);
      }
  </code></pre>
  
  <p>Any ideas?</p>