news-iOS-App icon indicating copy to clipboard operation
news-iOS-App copied to clipboard

Background refresh not updating badge

Open emichael opened this issue 5 years ago • 6 comments

It seems like the app isn't actually updating in the background. I have both "Sync on Start" and "Sync in Background" turned on in settings. I saw an update in the news on the nextcloud web client. The app was open in the background, I left it on the charger connected to wifi all night, and in the morning still no update to the unread badge. As soon as I opened the app it updated.

I'm running iOS 12.3.1 on an iPhone 8 and am using a Nextcloud 15 server. I have background app refresh turned on in the iOS settings as well.

emichael avatar Jun 21 '19 22:06 emichael

The app relies on the background fetch mechanism provided by iOS. The frequency and time of updates is determined by the OS. What you as a user can do to influence those parameters is to actually use the app. iOS will adapt to how frequently the app is opened, when it's being used, and if there is actually new data available to fetch.

phedlund avatar Jun 23 '19 18:06 phedlund

Sure, I just thought that 10+ hours was definitely long enough to wait based on my experience with other apps and background refresh. I'll keep an eye on it and see what happens after I've been using the app for a couple weeks.

emichael avatar Jun 23 '19 18:06 emichael

Other apps might have the possibility of sending silent push notifications in background letting it know that there is new content available. With the NextCloud model of personal servers it's hard to achieve something like that.

phedlund avatar Jun 23 '19 22:06 phedlund

I think I have more info. I noticed this morning that my server has a couple log entries like this every hour or two.

{"reqId":"XXXXXXXXXXXXXXXX","level":2,"time":"2019-06-24T19:59:16+00:00","remoteAddr":"192.168.1.12","user":"--","app":"core","method":"GET","url":"\/index.php\/apps\/news\/api\/v1-2\/feeds","message":"Login failed: '(null)' (Remote IP: '192.168.1.12')","userAgent":"iOCNews\/3.8.4 (iPhone; iOS 12.3.1; Scale\/2.00)","version":"15.0.8.1"}

192.168.1.12 is the IP of my iPhone on my LAN.

These entries do not appear when I manually refresh the app, and the sync does actually succeed then.

emichael avatar Jun 24 '19 21:06 emichael

Interesting. I have not seen that before. Try adding /index.php to the url when you log in from CloudNews. Have you configured pretty urls as described https://docs.nextcloud.com/server/16/admin_manual/installation/source_installation.html#pretty-urls?

phedlund avatar Jun 26 '19 03:06 phedlund

No luck with adding /index.php. Connection Failure on the client, I can't even add the server like that.

I have not configured pretty URLs. I'm running the snap distribution of Nextcloud, and it looks like there are some issues with trying to get that setup.

Sync is working when I refresh manually, though.

emichael avatar Jun 26 '19 04:06 emichael