Automattic / pocket-casts-android

Pocket Casts Android 🎧
https://forums.pocketcasts.com
Mozilla Public License 2.0
2.56k stars 213 forks source link

Notifications are not shown until the app is opened. #1615

Open csegyud opened 9 months ago

csegyud commented 9 months ago

Description

I have Google Podcasts (GP) and Pocket Casts (PC) installed side by side, cause I want to move to PC from GP, so I set he same subscriptions for both for testing. I receive GP notifications whenever a new episode is released, but PC keeps silent until I open the app. I have set the battery optimization to "no restrictions", while strangely GP hase "Battery saver (recommended)" option... I have also granted the notification permission to the app and turned it on inside the app settings.

Step-by-step reproduction instructions

  1. do not open the app for hours
  2. From GP notifications I know that my subscriptions have new episodes, but PC does not notify me
  3. open PC after a longer period and the notifications will immediately appear

Screenshots or screen recording

No response

Did you search for existing bug reports?

Device, Operating system, and Pocket Casts app version

Xiaomi 11T Pro MIUI Global 14.0.14 (TKDEUXM) Android 13 TKQ1.220829.002 Sec: Nov. 1. 2023 PC v7.52 (9168)

mchowning commented 9 months ago

👋 @csegyud ! Thanks for reporting this. It does sound like something might not be working correctly.

Let me try and rule out a few possible causes of this. The biggest thing I'd like to rule out is that the notification is not just being delayed. Are you saying that you never get new episode notifications until you open the app?

There are a few ways the notifications could be delayed on Pocket Casts compared to another podcast app.

The way new episodes get to the app is that we have a server that checks for changes to podcast feeds. Depending on how popular a feed is and how often it gets updated those checks can occur multiple times an hour for popular feeds that update a lot to once every few hours for smaller feeds that don't update very frequently. We're actively working on improving how quickly we get new episodes parsed on the server, but there is some inevitable delay between an episode being added to a podcast's RSS feed to it being available on our server. The reason we have the server parse the feeds is because it allows us to do a much better job of syncing your podcasts and episodes across multiple devices.

A second cause for the delay could be that we do not push new episodes to the app but instead the app checks for new episodes on the server roughly once an hour. So once the episode is available on the server, it could still be another hour before Pocket Casts checks for new episodes if the app is in the background (we check much more frequently if you're actively using the app).

In light of that, can you confirm that you never get new episode notifications until you open the app, even a few hours after the episode has been released?

Also, if you'd care to share the podcast(s) that you're seeing this issue with, I can check and make sure there aren't any issues with us parsing the feeds on the server.

csegyud commented 9 months ago

Hi @mchowning, thank you for the quick response.

Here are a few subscriptions to channels that are updated every day:

Other podcasts are updated less frequently in my lib.

Although I don't have channels that are updated several times a day, if you can send me one that is known to work well, I'd be happy to subscribe to it for testing.

To confirm your question, if I do not open the app for two days, the notifications are not delivered, until I open the app. It looks exactly as if the application has been optimised by the operating system, while it is in the no batter restrictions list.

MtndaleRedneck commented 9 months ago

@mchowning probably not the same issue but definitely related. Pocket Casts doesn't refresh in the background nearly enough. I'll frequently have that I open the app and all the sudden have 5 new podcasts come in at once. I have battery running on unrestricted. S22 ultra.

ricjcs commented 9 months ago

This occurs not only on MUI 14. I have pure Android 13 and I have exactly the same problem.

I don't receive notifications without opening the app.

I have set the app to use the battery without restriction, but I still don't receive notifications. Other postcast apps work well even without this option set.

mchowning commented 9 months ago

Thanks sharing more information.

If you look at your logs in the app (Profile → Help & Feedback (this moved recently) → three-line icon on the top of the screen), do you see anything in the logs while the app is in the background? About every hour or so, there should be a "RefreshPodcastsTask - Start" log entry followed by a bunch of other entries related to the refresh.

If the logs aren't showing that it is refreshing, then we know the app isn't running the refresh task for some reason. If that is showing up, then it seems like it's more likely a notification issue. Based on your descriptions it sounds like the refresh task isn't running at all, but the logs should confirm that.

csegyud commented 9 months ago

@mchowning , FYI, I intentionally didn't click the app since 14-Dec. evening. Here I attach a screenshot of my log - it shows the transition from the last run to the current: You can see that the app has never been awaken since 14-Dec until now.

I hope this gives you some clues.

viber_image_2023-12-20_15-52-00-864

MtndaleRedneck commented 9 months ago

Thanks sharing more information.

If you look at your logs in the app (Profile → Help & Feedback (this moved recently) → three-line icon on the top of the screen), do you see anything in the logs while the app is in the background? About every hour or so, there should be a "RefreshPodcastsTask - Start" log entry followed by a bunch of other entries related to the refresh.

If the logs aren't showing that it is refreshing, then we know the app isn't running the refresh task for some reason. If that is showing up, then it seems like it's more likely a notification issue. Based on your descriptions it sounds like the refresh task isn't running at all, but the logs should confirm that.

So it's supposed to background refresh only once per hour? Can we get an option to set it more often? I'm more than willing to accept the presumably minimal battery hit.

I get background refreshing presumably working properly but it's nowhere near frequently enough. It's very annoying to open the app and suddenly get 5 new podcasts at once.

CookieyedCodes commented 9 months ago

@MtndaleRedneck so you can force a refresh to be more frequent through their API, though a third party app I node coded it and it drained the battery like mad(regardless of battery management), the other issue is clocks are not the most accurate on android so even then its difficult 😅

ricjcs commented 9 months ago

If you look at your logs in the app (Profile → Help & Feedback (this moved recently) → three-line icon on the top of the screen), do you see anything in the logs while the app is in the background? About every hour or so, there should be a "RefreshPodcastsTask - Start" log entry followed by a bunch of other entries related to the refresh.

I confirm that I didn't have any record of a few hours without opening the app. The "RefreshPodcastsTask - Start" log, among others, only appeared when opening the app.

ricjcs commented 8 months ago

I suggest that the indication MIUI 14 be removed from the title of this issue, as this is a problem that also affects other versions of Android. Tests I did with other devices present the same problem.

I think this problem should have a high priority for resolution as it affects all or most Android users, this is quite annoying, receiving notifications only when opening the app makes the notifications useless. With the closure of Google Podcasts soon, millions of users will look for alternatives and the Pocket Cast app will certainly be a possible alternative, but this is a type of bug that can affect user retention.

ricjcs commented 8 months ago

I noticed that I have now been receiving notifications.

csegyud commented 8 months ago

@ricjcs still the same here, nothing changed. I have the latest ver according to Play App about: 7.53 (9174)

ricjcs commented 8 months ago

@ricjcs still the same here, nothing changed. I have the latest ver according to Play App about: 7.53 (9174)

Maybe the problem is on the server side. I have the same version and there was no update after opening this issue. But I confirm that I received notifications without opening the app. The only thing I notice is that notifications take a little longer to appear than those from Google Podcasts. I will report back here if any changes happen again.

mchowning commented 8 months ago

Maybe the problem is on the server side. I have the same version and there was no update after opening this issue. But I confirm that I received notifications without opening the app.

That's interesting. We don't have push notifications from the server, so it's unlikely this is a server issue. 🤔

CookieyedCodes commented 8 months ago

@mchowning it's likely due to android/os battery manger being extremely intense on certain pings, thus the app is not refreshing in the background, thus leading to notifications only being delivered once the app refreshes on opening some android varitys are alot stronger on battery saveing from my understanding:)

joashrajin commented 6 months ago

7756579-zd-a8c

george-tk commented 6 months ago

I can confirm on pixel 8 pro the exact same problem ; no refresh between 10am and 7pm Screenshot_20240305-193724

igotdes commented 5 months ago

Reported in #7874361-zen: