Skip to content
Snippets Groups Projects
  1. Jul 13, 2023
  2. Apr 23, 2022
  3. Aug 23, 2018
  4. May 22, 2018
  5. May 19, 2018
    • Eugen Rochko's avatar
      Improve payload format of Web Push API now that it's open (#7521) · 4b94e9c6
      Eugen Rochko authored
      > 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.
      Unverified
      4b94e9c6
  6. May 11, 2018
  7. Sep 02, 2017
    • unarist's avatar
      Fix WebPush (regression from #4524) (#4778) · bfa7f9eb
      unarist authored
      * Fix NoMethodError in Web::PushSubscription
      
      ```
      undefined method `site_contact_email' for #<Class:0x00005976d13c40>
      
      /usr/local/bundle/gems/activerecord-5.1.3/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
      /usr/local/bundle/gems/attr_encrypted-3.0.3/lib/attr_encrypted.rb:295:in `method_missing'
      /usr/local/bundle/gems/attr_encrypted-3.0.3/lib/attr_encrypted/adapters/active_record.rb:129:in `method_missing_with_attr_encrypted'
      /mastodon/app/models/web/push_subscription.rb:53:in `push_payload'
      ```
      
      * Specify serializer in Web::NotificationSerializer
      bfa7f9eb
    • Yamagishi Kazutoshi's avatar
      Add RoutingHelper (#4769) · b767eb7f
      Yamagishi Kazutoshi authored
      b767eb7f
  8. Sep 01, 2017
Loading