-
Do you ask here first for the latest push setup advice for iOS compat: xmpp:prosody@conference.prosody.im?join
-
Do you ask here first for the latest push setup advice for iOS compat:
Latest? For how long the documented way is obsolete?
It's clearly seen from the above that the stanza's being sent to the push.tigase.im and it even ack's it. But nothing arrives on the phone. Anything else the im server can do?
-
This outgoing stanza looks like a stanza used to register for push notifications at our push component and not the actual stanza with push notification (it is sent from a full JID, instead of bare JID or even just a domain name which is used for sending push notifications and its id is UUID which is used for generation of ids by SiskinIM and not used by Prosody for push notifications AFAIK)
https://hg.prosody.im/prosody-modules/file/fe5303da99cb/mod_cloud_notify/mod_cloud_notify.lua#l341
-
There are however "Invoking cloud handle_notify_request() for offline stanza":
May 18 12:31:07 tcpower.eu:mam debug Archiving stanza: <message id='83933E42-56F0-4559-B9D3-E99AC25DD356' type='chat' to='alice@tcpower.eu' from='bob@tcpower.eu/kd4ajdoz'> May 18 12:31:07 tcpower.eu:cloud_notify debug Invoking cloud handle_notify_request() for offline stanza
P.S.: It's a freakin' nightmare debugging on a live server...
-
Could you check if in your case Prosody is conffigured to send
last-message-body
? I do recall issues when this was not sent (even no dummuy body) as in this case those notifications are marked as "non important" and may be dropped by Apple Push Notification Services.If possible, I would recommend if possible and available, enabling this module https://hg.prosody.im/prosody-modules/file/tip/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua as it has support for sending encrypted push notifications over APNS and it is supported by SiskinIM (I'm not sure whether it is enabled on your installation or not).
-
Latest? For how long the documented way is obsolete?
I only know from random chats that for Snikket iOS some prosody stuff for better push was developed.
@mwild1 Ping
-
Could you check if in your case Prosody is conffigured to send
last-message-body
? I do recall issues when this was not sent (even no dummuy body) as in this case those notifications are marked as "non important" and may be dropped by Apple Push Notification Services.The inclusion of a
last-message-body
is regulated by thepush_notification_with_body
parameter, tried both variants with no effect. Here's a lua code:-- configuration local include_body = module:get_option_boolean("push_notification_with_body", false); local include_sender = module:get_option_boolean("push_notification_with_sender", false); local max_push_errors = module:get_option_number("push_max_errors", 16); local max_push_devices = module:get_option_number("push_max_devices", 5); local dummy_body = module:get_option_string("push_notification_important_body", "New Message!"); ... local function handle_notify_request(stanza, node, user_push_services, log_push_decline) ... if stanza and include_sender then form_data["last-message-sender"] = stanza.attr.from; end if stanza and include_body then form_data["last-message-body"] = stanza:get_child_text("body"); elseif stanza and dummy_body and is_important(stanza) then form_data["last-message-body"] = tostring(dummy_body); end
Another good question is how to make a stanza important if your statement is true? There are some hardcoded workarounds, may be Tigase also needs one?
If possible, I would recommend if possible and available, enabling this module https://hg.prosody.im/prosody-modules/file/tip/mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua as it has support for sending encrypted push notifications over APNS and it is supported by SiskinIM (I'm not sure whether it is enabled on your installation or not).
As I said
cloud_notify_extensions
is enabled and this is a wrapper for all (three) notify extension modules, including this one:module:depends("cloud_notify_encrypted"); module:depends("cloud_notify_priority_tag"); module:depends("cloud_notify_filters");
-
I only know from random chats that for Snikket iOS some prosody stuff for better push was developed.
For Snikket it's all the same, no notifications whatsoever. It has two small lua modules, tried them with no luck. Seeing
Invoking cloud handle_notify_request() for offline stanza
but then noSending %s push notification for %s@%s to %s (%s)
... -
@sirrosh Also, be sure you have lua-ossl installed, as per https://modules.prosody.im/mod_cloud_notify_encrypted
-
@sirrosh Also, be sure you have lua-ossl installed, as per https://modules.prosody.im/mod_cloud_notify_encrypted
Yes it is, otherwise
mod_cloud_notify_encrypted
throws an error on loading. Is there a way to check the "sanity" of a luaossl somehow? -
In this case, would you be able to catch the full XML stanza of the message which is not triggering a push notification? Maybe with that and the example Prosody configuration of your installation we would be able to find out why no push notification is being triggered.
Would appreciate your help on how to do it ;)
As I said the
Invoking cloud handle_notify_request() for offline stanza
is clearly seen butSending %s push notification for %s@%s to %s (%s)
doesn't follow. -
@sirrosh Maybe @mwild1 will be able to help you. I'm not a prosody developer or user.
-
In this case, would you be able to catch the full XML stanza of the message which is not triggering a push notification? Maybe with that and the example Prosody configuration of your installation we would be able to find out why no push notification is being triggered.
Continuing deeper into the
mod_cloud_notify
. This is an example of a notification subscription stanza for push.tigase.im, does it look ok?May 20 13:22:55 c2s56111e6323f0 info Attempting to enable push notifications May 20 13:22:55 c2s56111e6323f0 info No publish options in request May 20 13:22:55 c2s56111e6323f0 info Push notifications enabled for bob@tcpower.eu/iPhone (push.tigase.im<01#36749B8A3321876356DB71AFD4B5EC04C875E3200F12070B0AB4D7B11551188C) May 20 13:22:55 c2s56111e6323f0 info STANZA: <iq id='4E462E75-CEFB-4983-BC40-E9E83837971A' type='set' from='bob@tcpower.eu/iPhone'><enable jid='push.tigase.im' node='01#36749B8A3321876356DB71AFD4B5EC04C875E3200F12070B0AB4D7B11551188C' xmlns='urn:xmpp:push:0'><groupchat xmlns='tigase:push:filter:groupchat:0'/><priority xmlns='tigase:push:priority:0'/><encrypt alg='aes-128-gcm' max-size='3072' xmlns='tigase:push:encrypt:0'>pdqpDgUGNIcT9aRiXdQLsA==</encrypt><jingle xmlns='tigase:push:jingle:0'/></enable></iq>
This is how other (non-tigase) cloud_notify event and push stanza look:
May 20 13:29:29 c2s56111ae9b5d0 info Invoking cloud handle_notify_request() for newly smacks queued stanzas (now in timer) May 20 13:29:29 c2s56111ae9b5d0 info Invoking cloud handle_notify_request() for smacks queued stanza: 1 May 20 13:29:29 tcpower.eu:cloud_notify info Sending unimportant push notification for joe@tcpower.eu to p2.siacs.eu (9IKm1YIgBofR) May 20 13:29:29 tcpower.eu:cloud_notify info PUSH STANZA: <iq id='adb27750f405a01941ddb886102632dc62f88232af6e9a9f4e52b29b60cd3022' type='set' to='p2.siacs.eu' from='tcpower.eu'><pubsub xmlns='http://jabber.org/protocol/pubsub'><publish node='9IKm1YIgBofR'><item><notification xmlns='urn:xmpp:push:0'><x type='form' xmlns='jabber:x:data'><field type='hidden' var='FORM_TYPE'><value>urn:xmpp:push:summary</value></field><field type='text-single' var='message-count'><value>1</value></field><field type='text-single' var='pending-subscription-count'/><field type='jid-single' var='last-message-sender'><value>joe@tcpower.eu</value></field><field type='text-single' var='last-message-body'/></x></notification></item></publish><publish-options><x type='submit' xmlns='jabber:x:data'><field type='hidden' var='FORM_TYPE'><value>http://jabber.org/protocol/pubsub#publish-options</value></field><field var='secret'><value>4lLCWe1fygdbm+29ULys9PXd</value></field></x></publish-options></pubsub></iq> May 20 13:29:29 c2s56111ae9b5d0 info Cloud handle_notify_request() > 0, not notifying for other push queued stanzas of type unimportant
But for the tigase push client it's only:
May 20 13:30:31 tcpower.eu:cloud_notify info Invoking cloud handle_notify_request() for offline stanza
and here it stops. Waddaheck is going on???
Describe the bug Push notifications not working, meaning no notifications at all while the app is in the background.
To Reproduce Steps to reproduce the behavior:
Expected behavior After step 5 you should hear an incoming message notification on a locked phone.
Details
Additional context The moment the phone stop receiving notifications is exactly when the socket closes, after the "Connection closed" log message in Prosody. Both incoming and outgoing s2s connections to the push server are active:
Outgoing connection establishing:
As well as the incoming:
An offline stanza is being sent to the tigase push server:
after a while the server replies:
But nothing appears on the iphone's screen...