title: Push Notifications no longer working since iOS 13 for Xamarin app
body: <p>Since the public release of iOS 13 push notifications appear to no longer work for my Xamarin.Forms iOS project. I currently use Azure Notification Hub to send test notifications and previously, my iPhones would get notifications with no problem. Since iOS13 this is no longer happening.</p>
  
  <p>I don't use OneSignal but they did post an article about the changes that were made for Push Notifications: <a href="https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/" rel="nofollow noreferrer">https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/</a></p>
  
  <p>Is this problem still present? Or has anyone got any sources to confirm this issue other than SignalOne?</p>
  
  <pre class="lang-cs prettyprint-override"><code>public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) {
      if (Hub == null) {
          Hub = new SBNotificationHub(ApiConstants.ListenConnectionString, ApiConstants.NotificationHubName);
      }
  
      // Following from the comments with FreakyAli, I have added these 3 lines
      Byte[] result = new byte[deviceToken.Length];
      Marshal.Copy(deviceToken.Bytes, result, 0, (Int32)deviceToken.Length);
      String token = BitConverter.ToString(result).Replace("-", "");
  
      // Update registration with Azure Notification Hub
      Hub.UnregisterAllAsync(token, (error) =&gt; {
          if (error != null) {
              Debug.WriteLine($"Unable to call unregister {error}");
          }
  
          NSSet tags = null;
  
          Hub.RegisterNativeAsync(deviceToken, tags, (errorCallback) =&gt; {
              if (errorCallback != null) {
                  Debug.WriteLine($"RegisterNativeAsync error: {errorCallback}");
              }
          });
      });
  }
  </code></pre>
  
  <p>The code above worked all the time but during debugging I have noticed it no longer steps into <code>Hub.UnregisterAllAsync()</code> and I believe it is causing some error? (Can't make any sense of it though)</p>
  
  <pre><code>=================================================================
      Basic Fault Address Reporting
  =================================================================
  Memory around native instruction pointer (0x1bffaaf44):
  0x1bffaaf34  c0 03 
  5f d6 1f 
  20 03 d5 
  1f 20 
  03 d5 01 ec 
  7c 92  
  .._.. 
  ...
   ..
  ..|
  .
  0x1bffaaf44  20 00 c0 3d c3 f9 ff 10 
  62 04 c1 3c 02 0c 40 92 
    ..=.
  ..
  .b.
  .&lt;.
  .@.
  
  0x1bffaaf54  
  63 00 02 
  cb 61 00 
  c0 3d 00 1c a1 4e 
  05 00 
  00 
  14 
   c.
  ..
  a.
  .=.
  .
  .
  N....
  0x1bffaaf64  1f 20 03 d5 
  1f 20 03 d5 1f 20 03 d5 20 0c 
  c1 3c  . ..
  . ... .. ..&lt;
  </code></pre>
  
  <p>I have found these though - but I'm unsure how related these are to my current problem.
  <a href="https://github.com/Azure/azure-notificationhubs-dotnet/issues/88" rel="nofollow noreferrer">https://github.com/Azure/azure-notificationhubs-dotnet/issues/88</a>
  <a href="https://github.com/Azure/azure-notificationhubs-dotnet/issues/96" rel="nofollow noreferrer">https://github.com/Azure/azure-notificationhubs-dotnet/issues/96</a></p>