title: Safari web push notifications APNS returns 200 status, but notification not delivered to device
body: <p><strong>Issue</strong></p>
  <p>Sending Web Push Notifications to APNS returns a &quot;200&quot; OK status, but the notification never reaches my Mac computer.</p>
  <p><strong>Requesting permission to send Web Push Notifications</strong></p>
  <p>Created &quot;Website push id&quot; in developer.apple.com, wrote scripts to dynamically create the push package with all the appropriate hashes and signature.</p>
  <p>In Angular app I request permission and get the device token <a href="https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/Introduction/Introduction.html" rel="nofollow noreferrer">per this</a>:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  checkSafariPushPermission() : void{
      if ('safari' in window &amp;&amp; 'pushNotification' in window.safari) {
        this.checkAppleWebPushNotificationsRemotePermission(window.safari.pushNotification.permission(this.appleWebsitePushId));
      }
    }
  
  
    checkAppleWebPushNotificationsRemotePermission(permissionData: AppleWebPushNotificationPermissionsData) : void {
      let webServiceURL = this.globalVarsService.apiUrl + 'apple_pushnotifications/';
      if (permissionData.permission === 'default') {
          // This is a new web service URL and its validity is unknown.
          window.safari.pushNotification.requestPermission(
              webServiceURL, // The web service URL.
              this.appleWebsitePushId, // The Website Push ID.
              { userId: this.globalVarsService.userId }, // Data that you choose to send to your server to help you identify the user.
              function(permissionData: AppleWebPushNotificationPermissionsData) {
                this.permissionSet(permissionData);
              }
          );
      }
      else if (permissionData.permission === 'denied' || permissionData.permission === 'granted') {
          this.permissionSet(permissionData);
      }else{
        this.utilsService.doAlert("There was a problem processing your permissions selection with Apple.");
      }
    };
  
    
    permissionSet(permissionData: AppleWebPushNotificationPermissionsData) : void{
      console.log("Permission " + permissionData.permission)
      console.log("Token", permissionData.deviceToken)
    }
   </code></pre>
  </div>
  </div>
  </p>
  <p>On allowing permission this returns the <code>permissionData.deviceToken</code> correctly and the Push Package is added to my Mac so that I can see the web app listed in both Safari &quot;Preferences &gt; Websites &gt; Notifications&quot; where is shows with &quot;Allow&quot; selected.  And also in the Notification Centre where I have all the options for &quot;Banners&quot; &quot;Badges&quot; etc.</p>
  <p>So the permissions step appears to be working properly.</p>
  <p><strong>Sending Web Push Notifications</strong></p>
  <p>In developer.apple.com I created a Apple Push Notifications service key.</p>
  <p>In python using the <a href="https://github.com/genesluder/python-apns" rel="nofollow noreferrer">gobiko.apns library</a> I compose</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    client = APNsClient(
          team_id=APPLE_TEAM_ID,
          bundle_id=CERTIFICATE_NAME_FROM_P12_CERTIFICATE_ABOVE,
          auth_key_id=APPLE_WEB_PUSH_NOTIFICATION_APNS_KEYID,
          auth_key_filepath=APPLE_WEB_PUSH_NOTIFICATION_APNS_KEY_PATH,
          use_sandbox=False
      )
  
      client.send_message(
          'DEVICE_TOKEN_HERE',
          "This is my message"
      )</code></pre>
  </div>
  </div>
  </p>
  <p>The code executes without error and if I print the response from APNS it gives a &quot;200&quot; status ok.  No notification shows on the Mac computer and I can't see any way to debug.</p>
  <p>I am unsure if it is correct to use the &quot;name&quot; of the Website Push certificate from developer.apple.com as the <code>bundle_id</code>.</p>
  <p>I've also checked the do not disturb settings.</p>
  <p>I am aware that delivery is not guaranteed, but I'm not sure if it's working at all.</p>
  <p>Any debugging guidance would be appreciated. Thank you.</p>