igniterealtime/openfire-pushnotification-plugin

Add content to push notifications that allow them to wake up an IOS app

guusdk opened this issue · 0 comments

As explained in https://github.com/anurodhp/Monal/issues/354#issuecomment-614556811:

iOS is a special plattform and apps can not be woken up in the brackground by normal (silent) pushes.
Because of this an informal standard emerged which is not codified in the push xep:
The push has to be a push summary and the last-message-body field has to be set for pushes that were triggered by a message stanza containing a body (or was e2e encrypted!).
This way the push server can generate a non-silent push containing a general "New Message" which finally will start the app when the user opens the notification.

Example from prosody:

<iq id="id-1" type="set" from="xmpp.eightysoft.de" to="ios13push.monal.im">
   <pubsub xmlns="http://jabber.org/protocol/pubsub">
      <publish node="NODE">
         <item>
            <notification xmlns="urn:xmpp:push:0">
               <x xmlns="jabber:x:data" type="form">
                  <field var="FORM_TYPE" type="hidden">
                     <value>urn:xmpp:push:summary</value>
                  </field>
                  <field var="message-count" type="text-single">
                     <value>1</value>
                  </field>
                  <field var="pending-subscription-count" type="text-single" />
                  <field var="last-message-sender" type="jid-single" />
                  <field var="last-message-body" type="text-single">
                     <value>Neue Nachricht</value>
                  </field>
               </x>
            </notification>
         </item>
      </publish>
      <publish-options>
         <x xmlns="jabber:x:data" type="submit">
            <field var="FORM_TYPE">
               <value>http://jabber.org/protocol/pubsub#publish-options</value>
            </field>
            <field var="secret">
               <value>SECRET</value>
            </field>
         </x>
      </publish-options>
   </pubsub>
</iq>