-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
659 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ root = true | |
|
||
[*.js] | ||
indent_style = space | ||
indent_size = 4 | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 設定 | ||
|
||
 | ||
|
||
### messagingSenderId | ||
|
||
firebaseのコンソールから送信者ID(Sender ID)を取得、 | ||
public/firebase-messaging-sw.js のmessagingSenderIdを設定するに設定 | ||
(公開してよいID) | ||
|
||
### messageKey | ||
|
||
firebaseのコンソールで、web pushの証明書を追加し、公開鍵を設定取得して | ||
src/firebase/firebase.jsのmessageKeyに設定 | ||
(公開しても良い鍵) | ||
|
||
### server key | ||
firebaseのコンソールでサーバーキーを取得。メモしておく。設定する必要はない。pushを送るときに使う。 | ||
これは公開しては駄目なキー。 | ||
|
||
### client key | ||
デプロイして、ブラウザでアクセスする。 | ||
設定が成功していれば、通知許可するか聞かれるので許可する。 | ||
ブラウザのデバッグコンソールでclient keyを確認してコピー。メモる。 | ||
(公開しないほうがよいkey) | ||
|
||
 | ||
|
||
# push | ||
|
||
doc/以下で以下のコマンドでpushする | ||
|
||
``` | ||
SERVERKEY="{server_key}" CLIENTKEY="{client_key}" bash push.sh | ||
``` | ||
|
||
成功していれば通知が届く | ||
|
||
 | ||
|
||
|
||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
curl -X POST -H "Authorization: key=${SERVERKEY}" -H "Content-Type: application/json" -d "{ | ||
\"to\": \"${CLIENTKEY}\", | ||
\"notification\": { | ||
\"title\": \"FCM Message\", | ||
\"body\": \"Hello Singularity Society\", | ||
\"icon\": \"./img/icons/android-chrome-192x192.png\" | ||
} | ||
}" https://fcm.googleapis.com/fcm/send |
Oops, something went wrong.