-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show info messages for push #1560
Conversation
afaik we don't have polling implemented yet but would recommend to have a 10-15 minutes interval to not drain the battery. As a second step we could then of course go for a "smarter" polling looking at the frequency of notifications coming in. |
src/main/res/values/strings.xml
Outdated
@@ -703,4 +703,6 @@ | |||
|
|||
<string name="common_warning" translatable="false">Warning</string> | |||
<string name="corrupt_account_info" translatable="false">Accounts have been corrupted in case you have been using a release candidate of 2.0.0 between RC1 and RC5.\n\nWe are sorry to tell you that you need to remove the Nextcloud accounts from your device and need to re-login again completely in order to get fully working login-sessions on this device!</string> | |||
<string name="push_notifications_not_implemented">For this version push notification were disabled due to dependencies on proprietary Google play services.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we can shorten this to "Push notifications disabled due to dependencies on proprietary Google play services."
Yes that should work just fine |
"due to old login method" means nothing for the majority of people. Also, this shouldn't go in 2.0. We really have bugfixes to do for 2.0, and things like this can go maybe in 2.0.1. You have to use AlarmManager for F-droid as that is the only thing that currently guarantees the device will wake up. The interval can be decided I guess, but in order to know which notifications to show we'll have to store notifications in the DB and show only ones we haven't shown etc etc. As for other issue I see with this PR: it could happen that even with the proper login (webview) the first time you open notifications Push registration didn't finish yet. Or it failed. In this case a "wrong" error message would be shown that would confuse people. Also "Google play" -> "Google Play" |
@mario would you leave out the messages for 2.0.0 as well or just the polling because yes the polling is post 2.0.0 like Tobias mentioned in the description so I'd say we would be fine adding the messages (especially the Google Play one for the f-droid users). As for your scenario is there a way to detect that the push registration is not finished so we could then show yet another variant of the message? |
@AndyScherzinger there is currently no way to distinguish between a "just failed this time" and "failed because you use old login", but I guess I/you/whoever could add support for this by adding a status column to PushConfigurationState and handling return codes from the server. If you want the messages as a first step, sure - but please change the typo/capitalization and do the shortening. |
sure! As for the shortening do you mean the one I proposed? |
@AndyScherzinger yup. Plus find a way to change the "old login method" wording to something else. cc @tobiasKaminsky |
We decided at the conf to show only warnings as a first step for 2.0.
Is there a way to trigger "failing one time" so that I can catch the correct result type? Regarding the wordings: |
You actually need to check the return of the registration done with Nc server, not the proxy server. https://github.com/nextcloud/notifications/blob/master/docs/push-v2.md If you get a 400 when posting to POST /ocs/v2.php/apps/notifications/api/v2/push, and the Body contains INVALID_SESSION_TOKEN, then you're using a password instead of the app token and you could show this message. Also "Please consider to recreating your account." maybe? |
I added a third case:
--> temporary failure I hope this is now correct :-) For discussion of polling I'll open now a new issue: #1561 |
Regarding Drone/Lint: the one new warning is "obsolete dependencies" with targets the library. Rebase done |
c6a81ea
to
bd7e6fb
Compare
👍 please rebase 😁 cc @mario for review |
- no push possible (fdroid) - push possible, but old login
2d0a157
to
8c272da
Compare
Rebase done |
Sweet, then it can be merged after @mario approved it via 👍 |
Fine for now :) 👍 |
Show warnings if
I hope my idea is correct to use the push url / push return from google server.
Do we use polling, e.g. 1x / minute for fdroid, if this is possible? If not, then I will open up a new issue for 2.1.
resolves #1519
Old login:
Fdroid (thanks to Björn for helping with wording ;-) ):