Include path in web push payload for backwards compatibility
Old service workers cached in browsers still read `data.path` from the push notification payload. Include it alongside `data.url` so notification clicks keep working until those service workers update. Currently we only register the service worker in the notification settings screen, so this won't happen very often. Once we introduce offline mode, we'll register the service worker in more places, so we should be able to remove this.
This commit is contained in:
committed by
Rosa Gutierrez
parent
5b689dfac7
commit
fc0e477141
@@ -20,7 +20,7 @@ class WebPush::Notification
|
||||
end
|
||||
|
||||
def encoded_message
|
||||
JSON.generate title: @title, options: { body: @body, icon: icon_path, data: { url: @url, badge: @badge } }
|
||||
JSON.generate title: @title, options: { body: @body, icon: icon_path, data: { url: @url, path: @url, badge: @badge } }
|
||||
end
|
||||
|
||||
def icon_path
|
||||
|
||||
Reference in New Issue
Block a user