xabber-android icon indicating copy to clipboard operation
xabber-android copied to clipboard

Need high priority (?) Notifications

Open rrjanbiah opened this issue 2 years ago • 7 comments

Sorry, don't know the correct terminology...

The notification is not displaying in the lock screen. Always need to focus the application to view relevant notifications.

Version: Xabber Beta 3.0.2 Beta (824) Mobile: Redmi, Android 9

rrjanbiah avatar Oct 15 '21 12:10 rrjanbiah

Can it be because the app is simply terminated in the background by the OS? Xiaomi are infamous for automatically stopping background apps, and stopped app can't send notifications.

It is simple to determine if Xabber is running in the background - if you see a lightbulb icon in the presence area, it is running. If you don't, then it was killed.

andrewnenakhov avatar Oct 15 '21 12:10 andrewnenakhov

@andrewnenakhov Thanks a lot for your quick reply.

I can't seem to find the lightbulb in this version, but I vaguely remember in the previous versions.

However I think the app is online as my account is online for the other users.

I have a feeling that it may be due to some variations in the notification API call

rrjanbiah avatar Oct 15 '21 13:10 rrjanbiah

XMPP servers might show you 'online' to other users even if the app is terminated and no longer maintains an active connection.

You can check if the notifications are working in a very simple way:

  1. launch Xabber
  2. go to home screen, see if there is an active light bulb in the notifications are (if you swipe the notification area down it should expand to a full notification saying "Xabber, 1 of 1 accounts connected" (or "Xabber (online)", if you are somehow using newer builds)
  3. send yourself a message. If it will have a sound and notification, then it is working well when Xabber is running

Now, watch closely if this persistent notification disappears. If it does, then the app is killed off by OS, and there is little that can be done without relying on push notifications (we will eventually support push notifications, but servers also must support them)

See https://dontkillmyapp.com/ for more details. Xiaomi is one of the worst manufacturers according to their data.

andrewnenakhov avatar Oct 15 '21 14:10 andrewnenakhov

@andrewnenakhov Thank you so much for your detailed explanation. By Monday (once we have enough people to check the behaviour), will check again and will share more details. Thanks again for your awesome support.

rrjanbiah avatar Oct 15 '21 14:10 rrjanbiah

@andrewnenakhov I have checked the issue closely with different cases. Looks like my previous understanding is wrong. For now, I came to below findings:

  1. Notifications don't appear in the lock screen--always.
  2. Notifications don't have any sound
  3. WhatsApp notifications are looking ideal: Getting in lock screen, getting sound. So, if I'm on other app, I can understand the new notifications.
  4. For Gmail apps, some notifications seem to appear in lock screen and also some inside
  5. I don't think, Xabber is getting killed as you presume
  6. I still have a feeling that the Xabber notifications may be missing some extra flag or so.

And, so I googled and found couple of links:

  1. https://stackoverflow.com/questions/57332170/notifications-not-showing-on-lock-screen
  2. https://www.reddit.com/r/Xiaomi/comments/c279pw/found_a_solution_for_notifications_not_showing_in/ And, now I enabled few settings through "Manage apps" under "Settings". Will update the outcome by tomorrow.

Thanks again for your great work.

rrjanbiah avatar Oct 18 '21 13:10 rrjanbiah

There are interesting details, but whether WhatsApp is capable of showing notifications is irrelevant - they are clearly using push notifications and that's a whole different matter.

Before we proceed any further, one thing needs to be determined exactly: DOES Xabber run in the background, or DOES IT NOT. This determines the course of solving this problem: if it DOES, then there is something wrong with the notifications on Xiaomi, or, probably, notifications settings on a phone for Xabber are somehow messed up (very possible to do in Android 8 and later), and need to be restored to a correct state, or do we need to solve the more severe problem that Xabber is simply killed in the background and can't do anything.

Does your phone display the persistent notification for Xabber like it does on screenshots below?

andrewnenakhov avatar Oct 18 '21 14:10 andrewnenakhov

@andrewnenakhov Thank you so much for your awesome support.

Yes, I get something like (sorry, couldn't take a screenshot of notification as you did):

Xabber Beta
1 of 1 account online

Anyway, today I'm able to understand the exact issues! (Previously, I was goofing up as I was not sure what was wrong, as the notifications are different when compared to other apps)

  1. Xabber was missing lock screen notification--and so, I was missing messages and even buzzes during the phone was locked
  2. Xabber was missing sound--and so, I was missing messages and buzzes when I was on other apps (when the phone was not locked)

Now, I figured out that I have to enable notifications settings under Settings -> Manage apps -> Xabber Beta -> Notifications (multiple sub-options for private chat, group chat, buzz, etc. Screenshot attached below). I also enabled Autostart as mentioned in one online forum, but not sure if that's helping anything to keep the app persistent though.

Xabber settings - System

Previously, I was only looking at Xabber's native settings panel (screenshot attached below)

Xabber settings - Native

Now, I'm happy that my issues are sorted out. You may close this issue if you want.

From a usability point of view, I think, I never had to enable anything such for other apps. Or, probably I didn't use any other apps as frequently as Xabber. If settings cannot be grouped, may at least provide some shortcut link to this settings panel from Xabber's native settings panel.

rrjanbiah avatar Oct 19 '21 15:10 rrjanbiah