LoginSignup
1
0

More than 5 years have passed since last update.

github 通知サービス作ってみた nuxt.js + firebase auth

Last updated at Posted at 2019-04-02

github

hosting

やりたかったこと

firebase authを認証そのtokenで
Service Worker Notification API使用しバックグラウンド通知を行う

できなかったこと

Service Worker Notification APIを使用したバックグラウンド通知
頑張ったが無理だった.....
Firebase Cloud Messaging(FCM)を使ってAPIを叩いたら
Service WorkerでNotification APIで通知を置こうなうフローを想定していたが
githubから通知が来た際にAPIを叩くのではなく
1分間に一回APIを叩いて取りに行っているので
githubから通知が来た際にAPIを叩く手段がなく
サーバー側でtokenを登録して処理するしかないという答えにたどり着きました。
firebase cloud functionsではこういう処理ができないので
それならfirebase authを使う意味がなくなってしまいました....

できたこと

github通知がNotification APIで通知される

まとめ

やりたいことはできなかったけれど
nuxtjs基礎やvuexの使い方を学べたので収穫はあった
何より楽しかったのでよかった

自分が作った物の上位互換を紹介しておきます
Chromeの拡張機能ですがすごくいい
https://chrome.google.com/webstore/detail/notifier-for-github/lmjdlojahmbbcodnpecnjnmlddbkjhnn

1
0
0

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
1
0