Skip to content

Notification API - iOS Safari 16.4 does not support tag, icon, and more #19318

Open
@rejhgadellaa

Description

@rejhgadellaa

(I'm new to contributing here, hope it's ok that I grouped a bunch of (related) APIs together here)

What type of issue is this?

Incorrect support data (example: Chrome says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

Several Notification API features are marked as "supported" in iOS Safari 16.4 when, in fact, they are not - or do at least not behave as expected.

Notification API

https://developer.mozilla.org/en-US/docs/Web/API/Notification

While new Notification( title, options ) does return a notification instance, nothing happens. It does not show a notification.

So you could say that Safari technically supports it (as it doesn't throw an error) and you can inspect values like notification.tag and it reports the correct value, but it doesn't serve any purpose.

ServiceWorkerRegistration.showNotification()

https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification

While the support table doesn't mention the options below (the table seems to be incomplete?), the parameters chapter does.

However, support in iOS Safari seems to only cover title, options.body and (possibly) options.data. For example:

  • tag: is completely ignored and does not cause existing notifications with the same tag to be updated. Instead, a new notification is created.

  • icon: is completely ignored, iOS always shows the web app icon

  • close() may be supported but there's no way to get a list of notifications (registration.getNotifications()) always returns an empty array), so not sure how to get a hold of a notification and call that method?

ServiceWorkerRegistration.getNotifications()]

https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/getNotifications

As mentioned above, calling registration.getNotifications() always returns an empty array.

What browsers does this problem apply to, if applicable?

iOS Safari 16.4, possibly macOS

What did you expect to see?

I expect to either see "no support" or "partial support" for these features.

Did you test this? If so, how?

I used Peter Beverloo's excellent Notification Generator and some additional local testing to confirm my findings. Testing performed on an actual device (iPad Mini 5th gen) with STP dev tools connected.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

See linked MDN pages above.

Do you have anything more you want to share?

No response

MDN URL

No response

MDN metadata

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    data:apiCompat data for Web APIs. https://developer.mozilla.org/docs/Web/APIinfo neededThis needs more information to review or act on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions