tigase / siskin-im

(M) Public Project of Tigase Messenger for iOS devices based on Tigase Swift XMPP library.
GNU General Public License v3.0
173 stars 37 forks source link

Push in background not working #145

Open jelbana opened 2 years ago

jelbana commented 2 years ago

Describe the bug

I don't receive push notifications when the app is not open. My xmpp account is registered at movim.eu, which according to https://compliance.conversations.im/server/movim.eu/ supports XEP-0357.

To Reproduce

Push notifications are enabled in the settings. Notifications only come through when I open the app.

Details (please complete the following information):

licaon-kter commented 2 years ago

Both 1:1 & Groups?

Enabled Push in settings?

hantu85 commented 2 years ago

Please verify that you do not have "focus mode" enabled. With it enabled, iOS will filter out notifications.

jelbana commented 2 years ago

Both 1:1 & Groups?

Enabled Push in settings?

So far only tested 1:1.

Yes Push enabled in settings.

Please verify that you do not have "focus mode" enabled. With it enabled, iOS will filter out notifications.

It is not enabled.

I am able to receive notifications in Conversations on Android. I have also additionally tested disconnecting from Conversations and no change is observed.

jelbana commented 2 years ago

Both 1:1 & Groups?

I can confirm groups also do not work for push notifications. I can only get a notification when the app is open.

licaon-kter commented 2 years ago

@jelbana group messages push need a supported server, Tigase or Prosody (with newest special modules). But Movim runs ejabberd.

Eg. Make some test accounts on xmpp.cloud or tigase.im or jabberd.today or sure.im and test between them (all these run Tigase)

jelbana commented 2 years ago

@jelbana group messages push need a supported server, Tigase or Prosody (with newest special modules). But Movim runs ejabberd.

Eg. Make some test accounts on xmpp.cloud or tigase.im or jabberd.today or sure.im and test between them (all these run Tigase)

Happy to test group notifications afterwards. It seems 1:1 is also not receiving push notifications.

hantu85 commented 2 years ago

@jelbana Could you check if you do not have any hanging notifications from Siskin on your iOS device? I've seen issues caused by filtering notifications by iOS if old notifications were still in the notifications center.

On the server side, I do see notifications from movim.eu being properly processed and forwarded to APNs for delivery.

jelbana commented 2 years ago

@jelbana Could you check if you do not have any hanging notifications from Siskin on your iOS device? I've seen issues caused by filtering notifications by iOS if old notifications were still in the notifications center.

On the server side, I do see notifications from movim.eu being properly processed and forwarded to APNs for delivery.

No hanging notifications from Siskin are present. Anything else I can do to test push notifications?

jelbana commented 2 years ago

Push in 1:1 seems to be working all of a sudden. I'm not sure I changed any of the settings other than retoggling the push notifications toggle. I will monitor it for a couple days before closing the thread.

jelbana commented 2 years ago

@licaon-kter @hantu85

Currently 1:1 push notifications are working, but calling does not work. If I open Siskin while an audio call is made, only then do I do get a notification and the option to accept/reject. Is this related to the way push is implemented differently on Movim as opposed to tigase? Or should I expect it to work as well?

licaon-kter commented 2 years ago

Yes, this should work (iirc) for calls too on Tigase servers, see the list to test with, above.

niklasliebig commented 2 years ago

I have the same problem here for college of mine. He won't get notifications when Siskin is in the background.

Describe the bug In most cases, no message notification if a message arrives and Siskin is not opened on the screen (1:1 and group chat)

To Reproduce Background app refresh and Push are enabled. Focus mode is disabled (iOS 15.02 only).

Details Device: iPhone SE 1st generation Operating system: iOS 14.8 & iOS 15.0.2 Software: Siskin 6.4 (AppStore) Server: Mailbox.org (supports XEP-0357: Push Notifications)

hantu85 commented 2 years ago

@niklasliebig Do you know which server (software) is being used at mailbox.org? It sends notifications but does not include <x/> element with a summary of notification (even an empty one). Due to that those notifications are sent as regular notifications to iOS devices instead of "prioritized" notifications and may more often be dismissed by the iOS.

Most (if not all) XMPP servers are now sending important push notifications (related to message) either with <x xmlns-"jabber:x:data"/> element being included or add <priority xmlns="tigase:push:priority:0">high</priority>.

Without those markings from the XMPP server for notifications related to actual messages, we cannot mark them as high-priority notifications which may lead to those notifications being dropped.

licaon-kter commented 2 years ago

https://compliance.conversations.im says which software, ejabberd (unfortunately stuck in time in Dec 2018 as when iNPUTmicose visited them :()

hantu85 commented 2 years ago

Then it may need to be updated for push notifications to work correctly with SiskinIM.

niklasliebig commented 2 years ago

Thanks in advance for your advice. I'll try to get in touch with mailbox.org and come back here later. @licaon-kter The compliance tests says: "Server is running ejabberd 18.12.1-2". This (18.12.) is not to be confused with the date the compliance checks were last performed, which appears to be 10/22/2021.

licaon-kter commented 2 years ago

@niklasliebig my comment was about the software version, then again testing in Dec 2018 or Dec 2021 will yield the same results

niklasliebig commented 2 years ago

In the meantime we have tested two more servers: tigase.im and honigdachse.de. Both test accounts also do not give a notification for incoming messages when siskin is in the background. On the sender side we use jabber.de. Can we do further testing or provide useful information to help solving the issue? I would be glad to do so.

woj-tek commented 2 years ago

@niklasliebig -- does the siskin user have account on tigase.im or on honigdasche.de server? In general if the account is on tigase.im (or sure.im, jabber.today or any other modern xmpp server) it should work just fine.

niklasliebig commented 2 years ago

@woj-tek Yep, we actually created test accounts on both servers: ...@honigdachse.de and ...@tigase.im. Unfortunately there are no push notifications for Siskin 6.4 (AppStore) running on the iPhone SE 1st generation when the app is in the background and the screen is off.

woj-tek commented 2 years ago

How do you put the application in the background? Using home button? Do you kill the application when it's in the background? Could you try disabling and re-enabling push on that account?

woj-tek commented 2 years ago

Also - could you try the latest testflight version?

milkywade commented 2 years ago

Having the same issue. Using iOS 15.0.2. No focus activated. Only when I launch the app I get notifications, not in in background.

hantu85 commented 2 years ago

@milkywade Could you at least state which version of Siskin IM are you using? AppStore or TestFlight? and which device are you using?

milkywade commented 2 years ago

Appstore iPhone 11

-- Sent from a mobile device

On Thursday, Oct 28, 2021 at 1:00 PM, Andrzej Wójcik @. @.)> wrote:

@milkywade (https://github.com/milkywade) Could you at least state which version of Siskin IM are you using? AppStore or TestFlight? and which device are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/tigase/siskin-im/issues/145#issuecomment-953737217), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AKNJKNDUEZRDASJE6H26OTDUJE3PHANCNFSM5FWVPI5A). Triage notifications on the go with GitHub Mobile for iOS (https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android (https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).

niklasliebig commented 2 years ago

@woj-tek:

How do you put the application in the background? Using home button?

Yes, he uses the home button.

Do you kill the application when it's in the background?

We don't kill the application. At least we are not aware of it.

Could you try disabling and re-enabling push on that account?

Yep, we did that.

We have done a lot of retests and it appears that the Mailbox.org Server software is the main reason for not receiving notifications. Thank you for looking at the missing x element issue @hantu85. In the meantime, we've also made some mistakes on our side by forgetting to turn the notifications back on. All in all, our Siskin version works well with jabber.de, tigase.im and honigdachse.de and brings the notifications even after restarting the phone (and not touching the Siskin app). In some cases, the notification arrived, but the message itself took a few seconds to show up in the app. The funny thing is that the Siskin version we used (6.4 from the AppStore) even shows a notification when an account is deactivated. The deactivation of the account should include disable notifications in my understanding. So we learned a lot. Thanks again for your help. And no, my college is not going to try the Testflight version.

hantu85 commented 2 years ago

The "account deactivation" "issue" is already solved in version 7.0 which is now being tested.

shodanx2 commented 1 year ago

Hello, This issue comes up in google when search for xmpp siskin notification problem. I don't know if I have a misconfiguration error of this doesn't work for everyone else but...

I have an xmpp service provided by ejabberd And 3 friends who use either gajim+conversation and gajim+siskin

The two who use siskin, do not ever get their message notifications our chatroom. They need to open the app to see what is new, they don't get a notification.

My understanding is that I need to register as a developper with apple and compile my own version of siskin to get APN communication API keys, get my copy of Siskin on the app store, have them install it. Then program some kind of bridge between XMPP ejabberd server and Apple's APN infrastructure using my developper API keys. And probably create a plugin in ejabberd to send the actual notification to the bridge.

Is that what it will take to get my apple using friends to get my chat notifications ?

It seems easier to get non-apple using friends instead or maybe trying signal, I heard it's open source so maybe ?

licaon-kter commented 1 year ago

No, Siskin devs already did that for you, the developer part.

Some issues that are known

Try with Monal too, it keeps (or tries at least) a connection open for longer to the server.

Read: https://eversten.net/en/blog/notification/