title: iOS 13 - silent push notifications are no longer reliable
body: <p>iOS 13 changes:</p>
  
  <p>Change 1: In iOS 13 Beta 6, a silent remote notification (AKA Background Notification) with priority 10 is no longer handled by the OS and dropped. This was documented in the past but never enforced.</p>
  
  <p><a href="https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns?language=objc" rel="noreferrer">Doc</a>:</p>
  
  <p><strong><em>It's an error to specify this priority (10) for a notification whose payload contains the content-available key.</em></strong></p>
  
  <p>Log:</p>
  
  <blockquote>
    <p>error 14:11:19.224387 +0300 dasd Not Supported: High-priority silent push. (App=) </p>
    
    <p>default 14:11:19.224713 +0300 dasd Daemon Canceling Activities: {(   com.apple.pushLaunch.com.some.bundle:64660B )} </p>
    
    <p>default 14:11:19.225032 +0300 dasd CANCELED: com.apple.pushLaunch.com.some.bundle:64660B at priority 10 !</p>
    
    <p>default 14:11:19.225363 +0300 dasd Removing a launch request for application  by activity </p>
  </blockquote>
  
  <p>Change 2: a new key, apns-push-type, is required when delivering notifications to devices running iOS 13 with the value <code>background</code> or <code>alert</code>.</p>
  
  <p>After complying with the above, I'm still seeing random behavior regarding silent remote notifications. I can see that the notification arrives to the device and in some cases (even when the device is connected to a power source) the notification is dropped by the OS.</p>
  
  <p>Fail Log:</p>
  
  <blockquote>
    <p>default   12:19:33.450155 +0300   dasd    Submitted Activity: com.apple.pushLaunch.some.bundle:3B0049 at priority 5 &lt;§private></p>
    
    <p>default   12:19:33.457216 +0300   dasd    Push not allowed for &lt;§private></p>
    
    <p>default   12:19:33.457355 +0300   dasd    Daemon Canceling Activities: {(
        com.apple.pushLaunch.some.bundle:3B0049
    )}</p>
  </blockquote>
  
  <p>Success log:</p>
  
  <blockquote>
    <p>default   14:37:33.633462 +0300   dasd    Submitted Activity:
     com.apple.pushLaunch.com.some.bundle:D1EEDF at priority 5 &lt;§private></p>
    
    <p>default   14:37:33.639191 +0300   dasd    Adding a launch request (&lt;§private>)
     for application  by activity &lt;§private></p>
    
    <p>default   14:37:33.639240 +0300   dasd    Launch requests for &lt;§private>:
     &lt;§private></p>
  </blockquote>
  
  <p>Going back to the doc:</p>
  
  <p><strong><em>Specify 5 to send the notification based on power considerations on the user’s device. Use this priority for notifications whose payload includes the content-available key. Notifications with this priority might be grouped and delivered in bursts to the user’s device. They may also be throttled, and in some cases not delivered.</em></strong></p>
  
  <p>From what I'm seeing, silent notifications are throttled and not delivered randomly (even if the battery is full and the device is connected to a power source)  </p>
  
  <p>Still trying to figure out if this is the correct behavior or a bug that Apple is going to fix.</p>