mastodon/app/javascript/mastodon
Eugen Rochko 4b94e9c65e
Improve payload format of Web Push API now that it's open (#7521)
> Good lord what is happening in there

Previously the contents of the Web Push API payloads closely resembled the structure of JavaScript's [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification). But now that the API is open to non-browser apps, and given that there is no required coupling between contents of the payload and a Notification object, here is how I changed the payload:

```json
{ 
  "access_token": "...",
  "preferred_locale": "en",
  "notification_id": "12345",
  "notification_type": "follow",
  "title": "So and so followed you",
  "body": "This is my bio",
  "icon": "https://example.com/avatar.png"
}
```

The title, body and icon attributes are included as a fallback so you can construct a minimal notification if you cannot perform a network request to the API to get more data.
2018-05-19 14:46:47 +02:00
..
actions Improve payload format of Web Push API now that it's open (#7521) 2018-05-19 14:46:47 +02:00
components Open video modal on public UI (#7469) 2018-05-13 13:48:14 +02:00
containers Open video modal on public UI (#7469) 2018-05-13 13:48:14 +02:00
features Reword the direct message warning (#7420) 2018-05-16 14:47:11 +02:00
locales Improve payload format of Web Push API now that it's open (#7521) 2018-05-19 14:46:47 +02:00
middleware Add missing rejection handling for Promises (#7008) 2018-04-02 14:51:02 +02:00
reducers Skip pagination logic for pinned account timelines in reducer (#7540) 2018-05-19 02:51:29 +02:00
selectors
service_worker Improve payload format of Web Push API now that it's open (#7521) 2018-05-19 14:46:47 +02:00
storage Test if navigator.storage.estimate exists before using it (#7504) 2018-05-15 20:15:08 +02:00
store
utils Fix images resized in browser getting cropped (#7514) 2018-05-16 16:24:16 +02:00
.gitkeep
api.js
base_polyfills.js Refactor resizeImage method (#7236) 2018-04-23 09:15:51 +02:00
compare_id.js Fix comparing id (#7180) 2018-04-18 16:50:19 +02:00
extra_polyfills.js
initial_state.js When search enabled, display hint in search popout (#6593) 2018-03-02 06:02:42 +01:00
is_mobile.js
link_header.js
load_polyfills.js Refactor resizeImage method (#7236) 2018-04-23 09:15:51 +02:00
main.js
performance.js
ready.js
rtl.js
scroll.js
settings.js Implement tag auto-completion by history (#6621) 2018-03-04 20:27:25 +01:00
stream.js Use randomized setTimeout when fallback-polling and re-add since_id (#7522) 2018-05-18 02:32:35 +02:00
test_setup.js
uuid.js