Skip to content
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

Push notifications disabled due to depedencies on proprietary Google Play Services #2301

Closed
ardevd opened this issue Mar 6, 2018 · 10 comments

Comments

@ardevd
Copy link
Collaborator

ardevd commented Mar 6, 2018

When I launch the Notifications Activity a persistent SnackBar appears at the bottom saying that Push notifications are disabled due to dependencies on proprietary Google Play Services.

Looking at the code, the message is triggered here in NotificationsActivity line 154.

String pushUrl = context.getResources().getString(R.string.push_server_url);
 
if (pushUrl.isEmpty()) {
 snackbar = Snackbar.make(emptyContentContainer, R.string.push_notifications_not_implemented,
         Snackbar.LENGTH_INDEFINITE);

The push_server_url string is hardcoded as https://push-notifications.nextcloud.com so I cant quite see the connection between the actual error, the pushUrl string being empty or null, and the snackbar error message.

Seeing this on a Pixel 2 XL running Android 8.1 with Google Play services installed.

@mario
Copy link
Contributor

mario commented Mar 6, 2018

Hmmm ... how did you login? You need to login using login flow in order to have push.

@ardevd
Copy link
Collaborator Author

ardevd commented Mar 6, 2018

I logged in the only way I thought was possible. Still doesn't explain the error message though which gives the impression that Google Play services are missing, which is not the case.

The code there doesn't really make much sense to me. The string resource is obviously not empty so the string object will only be empty if context is null, which is still no indication that Google Play services is missing. Bear in mind I only briefly glanced over the code so there might be some obscure logic to this that I've missed :)

@mario
Copy link
Contributor

mario commented Mar 6, 2018

You're right. @tobiasKaminsky is the latest release gplay flavour?

@ardevd
Copy link
Collaborator Author

ardevd commented Mar 7, 2018

I realize now that the push_server_url string is not in strings.xml. It's found in two places:

gplay/res/values/setup.xml and main/res/values/setup.xml. The latter is an empty string and the primary is https://push-notifications.nextcloud.com.

A bit confused as to how you've designed this.

@mario
Copy link
Contributor

mario commented Mar 7, 2018

It's designed this way in order to support building both push-enabled Google Play release and push-disabled F-Droid release. Anyway, let's wait to see what @tobiasKaminsky says if he built a gplay release.

@tobiasKaminsky
Copy link
Member

Yes, latest release is built with gplay release (I am always testing this).
I tested it with a fresh new emulator and it is working, meanwhile I found missing support for 8.x --> #2335

As this @ardevd is also using 8.x I think this is related to #2335.

@ardevd
Copy link
Collaborator Author

ardevd commented Mar 12, 2018

@tobiasKaminsky You're probably correct then. I think we can mark this as a duplicate of #2335 for sure.

@tobiasKaminsky
Copy link
Member

Hmm. While thinking about this, it seems to be independent for me.
On my fresh emulator, I never saw the "due to dep" snackbar, but instead I got a warning when a push notification is received.
Sorry that I read it wrong.

Have you installed the app from google play store?

@Mickael-Martin
Copy link

Hello,
Sorry, I'm not remember if I ask the question : Why Nextcloud not use http/2 push notification if the server support this feature ?

@stale
Copy link

stale bot commented May 10, 2019

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@stale stale bot added the stale label May 10, 2019
@stale stale bot closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants