0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

デスクトップ通知調査(with RoR)

Posted at

デスクトップ通知

https://www.lanches.co.jp/blog/6723
https://qiita.com/otolab/items/72ac10a0880ea411d77e
https://tech.speee.jp/entry/2017/12/21/111404
https://tech.mercari.com/entry/2017/12/19/workbox

大まかな流れ

uml.png

ライブラリ

Gem

webpush

  • Ruby のアプリケーションに Web Push の機能を追加する。
    • VAPID Key の生成。
    • 鍵を使ったサーバー・クライアント間の安全な通信。
    • 通知の発行。

serviceworker-rails

  • RailsPWA 対応する。
  • Assets 等は起動時にコンパイルされてファイル名が動的に決定されるので、素の Service Worker では対応できないなど。

Npm

Workbox

  • Google 製の PWA 構築のためのライブラリ。
  • PWA に関する諸々を簡単に実装できる。
  • 標準的な事以外をやらせようとすると上手くいかない。

キーワード

VAPID (Voluntary Application Server Identification)

https://qiita.com/tomoyukilabs/items/9346eb44b5a48b294762
https://tools.ietf.org/html/rfc8292

Abstract

An application server can use the Voluntary Application Server
Identification (VAPID) method described in this document to
voluntarily identify itself to a push service. The "vapid"
authentication scheme allows a client to include its identity in a
signed token with requests that it makes. The signature can be used
by the push service to attribute requests that are made by the same
application server to a single entity. The identification
information can allow the operator of a push service to contact the
operator of the application server. The signature can be used to
restrict the use of a push message subscription to a single
application server.

  • manifest.json が必要とか必要ないとか、情報源によって差がある。
    • スマホのホームにアプリとして追加するときに必要な設定
  • ページロード時に購読を確認するか、ボタン等で購読するか選ばせる。
0
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?