New issue
Advanced search Search tips

Issue 908255 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

gcm notifications received, but not showed

Reported by patrick...@gmail.com, Nov 25

Issue description

Steps to reproduce the problem:
well, I'm not sure you can reproduce it,
it's an error in my end,
I'm posting it in case you can help

after registering for notifications in a site in chrome,
notifications are coming through, but are not shown in my device, in the following section is the catlog part

What is the expected behavior?

What went wrong?
11-25 13:02:00.302 D/GmsGcmMcsInput(2732): Incoming message: DataMessageStanza{id=4CBDA87A, from=34167562045, category=com.android.chrome, app_data=[AppData{key=alert, value=ΓΚΟΛ! - Φουενλαμπράδα 29 λεπ
11-25 13:02:00.312 D/GmsGcmMcsSvc(2732): Target: ResolveInfo{3449dc4 com.android.chrome/com.google.android.gms.gcm.GcmReceiver m=0x108000}
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): Received an invalid GCM Message
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): java.lang.IllegalArgumentException: Received push message with no subtype
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at bHz.<init>(SourceFile:8)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at boP.run(SourceFile:2)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at android.os.Handler.handleCallback(Handler.java:751)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at android.os.Handler.dispatchMessage(Handler.java:95)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at android.os.Looper.loop(Looper.java:154)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at android.app.ActivityThread.main(ActivityThread.java:6236)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at java.lang.reflect.Method.invoke(Native Method)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
11-25 13:02:00.396 E/cr_ChromeGcmListener(8661): 	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:103)

Did this work before? N/A 

Chrome version: 70.0.3538.110  Channel: stable
OS Version: 7.1.2
Flash Version:
 
Labels: Needs-triage-Mobile
Cc: chelamcherla@chromium.org
Components: UI>Notifications
Labels: Needs-Feedback Triaged-Mobile
@patrickdrd: Could you please provide steps to reproduce the issue along with the device details on which this issue is seen. This would help in further triaging of the issue.

Thanks!
the device is xiaomi redmi note 5a running aosp rom with microg 
(I contacted them too),
the steps are described above, subscribe to any site for notifications,
but when the notification arrives, it isn't shown!
Project Member

Comment 4 by sheriffbot@chromium.org, Nov 26

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
same error on another device running microg on custom rom based on lollipop 5.1, I even uninstalled chrome from the original device and
installed again without any data restore or setting up sync and
the same issue occurred,

why isn't the notification showing up?
what's that subtype that's preventing it from display?
I can't say it's the site's fault because
I've got a third device (nougat 7.1, same chrome version),
which receives these notifications fine

the code should be this:

    private void pushMessageReceived(final Bundle data) {
        final String bundleSubtype = "subtype";
        if (!data.containsKey(bundleSubtype)) {
            Log.w(TAG, "Received push message with no subtype");
            return;
        }

https://chromium.googlesource.com/chromium/src/+/4805f933d6a3209f466cfcfeaf550b2dd011f051/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java

Status: WontFix (was: Unconfirmed)
Hi Patrick, the code that you link to is from Chrome 51, is that the version you're using? We're currently developing Chrome 72, and won't be able to help you with such old code anymore.

Web Push Notifications require a subtype so that Chrome can distinguish between the app (e.g. com.android.chrome) and the website within the app (e.g. https://example.com). Without it, we have no way of knowing which site the message is intended to be delivered to.

Looking at the intent you receive,
{
  category = com.android.chrome,
  data = {
    key = alert,
    value = "ΓΚΟΛ! - Φουενλαμπράδα 29 λεπ"
  }
}

I observe two things:

  (1) the subtype is indeed missing, so we have no way of processing the message
  (2) the data is not encrypted; Chrome requires the push message's payload to be encrypted in order to deliver it

Based on this, the GCM message that's being delivered is not compatible with the system that's intended to handle it, and the error is correct.

You can find more information about the feature here:
  https://developers.google.com/web/fundamentals/push-notifications/

I'm closing this as WontFix as there's very little we can do here, but am happy to respond to further conversation.
I found this code on google, searching for chrome and subtype

the site is bet365.gr, I didn't mention it, because I think it's irrelevant,
my bet is that the same would happen to all sites,
but I used that one, because it's the easiest site to test,
you just open an online match played and press the right icon to subscribe to notifications for that match,
anyway, as I said in my previous message, it's not the site's fault,
because I'm receiving notifications from it from another device,
stock rom nougat 7.1, 
my question is, why can't this work on this one (aosp 7.1 with microg),
I'm a developer too (not android though) and it feels very strange to me
I suppose your version of Android doesn't have Google Play Services available, or an alternative version thereof? Chrome is receiving an invalid push message, so something on the system is doing the wrong thing.
it includes microg, which is:

[quote from xda-developers.com]
microG GmsCore is a FLOSS (Free/Libre Open Source Software) framework to allow applications designed for Google Play Services to run on systems, where Play Services is not available[/quote]

so, that's why the notification isn't shown?
microg can't handle it?

Correct. They would have to support subtypes and include this with the information they send to Chrome.
oh, I see, thank you very much peter, 
I'm quoting your message over to them
I tried your page and it worked:
https://tests.peter.sh/notification-generator/

do you have another page to try?
The notification generator displays locally created notifications, the issue you're running in to are push messages.

https://tests.peter.sh/push-message-generator/
  1) Click on Subscribe
  2) Click on Send Message
  3) *poof*
I can't even subscribe!
registration failed
push service error
That would be a good place to start then. Unfortunately this isn't a use case we support, but people are welcome to reach out to me for info and clarifications.

Sign in to add a comment