Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Extensions can no longer create notifications #14993

Closed
dessant opened this issue Sep 11, 2020 · 11 comments
Closed

[Bug] Extensions can no longer create notifications #14993

dessant opened this issue Sep 11, 2020 · 11 comments

Comments

@dessant
Copy link

dessant commented Sep 11, 2020

Steps to reproduce

The API call below no longer shows a notification in Firefox Nightly 200911 14:03.

Extension notifications on Android worked up to Firefox 78. In Firefox 79 and 80 the API call crashes the browser. This crash was recently fixed, but the end result is that notifications are no longer shown.

#12910
https://bugzilla.mozilla.org/show_bug.cgi?id=1649494

browser.notifications.create({type: 'basic', title: 'Title', message: 'Message.'});

Device information

  • Android device: Android 9
  • Fenix version: Firefox Nightly 200911 14:03

┆Issue is synchronized with this Jira Task

@dessant dessant added the 🐞 bug Crashes, Something isn't working, .. label Sep 11, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Sep 11, 2020
@dessant
Copy link
Author

dessant commented Sep 11, 2020

While notifications work up to Firefox 78, only a notification icon is shown in the status bar and no notification sound is produced. In Fennec a notification popup would also appear, accompanied by a notification sound.

This is causing problems for Search by Image, because errors are shown using notifications and the status bar icons alone are easy to miss, so the user is left wondering why selecting an image does nothing, while there is a notification hiding above about a missing image.

@kbrosnan
Copy link
Contributor

kbrosnan commented Oct 7, 2020

@agi do we need GV work to support this API. I did not see anything in Bugzilla.

@jonalmeida
Copy link
Contributor

While notifications work up to Firefox 78, only a notification icon is shown in the status bar and no notification sound is produced. In Fennec a notification popup would also appear, accompanied by a notification sound.

@dessant so the notification does show up, but as a silent notification, is that correct? If so, they it's an AC bug probably with the NativeNotificationBridge.

@dessant
Copy link
Author

dessant commented Oct 7, 2020

@jonalmeida, notifications do not show up at all, nothing happens when the API is called. The browser.notifications API only worked up to Firefox 78.

@dessant
Copy link
Author

dessant commented Oct 7, 2020

Please see the brief history of the bug in the issue description, it might help find the root of the bug.

@agi
Copy link
Contributor

agi commented Oct 7, 2020

@kbrosnan no, we do notify AC of the notification through the WebNotificationDelegate::onShowNotification API (there's a test for this in https://phabricator.services.mozilla.com/D88165), this is likely a bug in AC/Fenix.

@csadilek csadilek moved this from ⏳ Sprint Backlog to 🏃‍♀️ In Progress in A-C: Android Components Sprint Planning Oct 23, 2020
@csadilek
Copy link
Contributor

@dessant Thanks for filing! Just tested in latest Nightly (201027 17:01) to confirm that this works now. Please re-open if you still run into issues.

A-C: Android Components Sprint Planning automation moved this from 🏃‍♀️ In Progress to 🏁 Done Oct 27, 2020
A-C: WebNotification & WebPush automation moved this from Backlog to Done Oct 27, 2020
@Offerel
Copy link

Offerel commented Oct 28, 2020

I can confirm that the notification is displayed now. But i fear, i have another issue with notifications. If i try to interact with the notification, the onClicked event isnt fired. For example:

browser.notifications.onClicked.addListener(function(notificationId) {
  console.log('Notification ' + notificationId + ' was clicked by the user');
});

This will not triggered. I didnt see the output in the console. Should i open a second issue for this?

@agi
Copy link
Contributor

agi commented Oct 29, 2020

@Offerel
Copy link

Offerel commented Oct 29, 2020

Hopefully this is OK: https://bugzilla.mozilla.org/show_bug.cgi?id=1674069

@jonalmeida
Copy link
Contributor

@Offerel I believe what you are seeing is this issue in AC: mozilla-mobile/android-components#7477

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Development

No branches or pull requests

7 participants