# プッシュ通知で作るファイル共有アプリ
2024/04/18@IT系の濃ゆい話をする会
---
# 自己紹介
- みやまえ @yicru
- 広島でWebエンジニアをしています
- 今週人生初自作PCを組み立てました
---
# 前回の濃ゆい会にて
- P2PにPush通信が使えるのでは?
- https://scrapbox.io/it-deep-talk/IT%E7%B3%BB%E3%81%AE%E6%BF%83%E3%82%86%E3%81%84%E8%A9%B1%2313
---
# プッシュ通知仕組み
## プッシュ通知サーバーに通知内容を送信
- FCM (Firebase Cloud Messaging)
- Googleのプッシュ通知サーバー
- APNs (Apple Push Notification service)
- Appleのプッシュ通知サーバー
---
# サイズの上限は?
---
# FCM
> ほとんどのメッセージの上限は 4,096 バイトです。
https://firebase.google.com/docs/cloud-messaging/send-message?hl=ja
---
# APNs
> - For Voice over Internet Protocol (VoIP) notifications, the maximum payload size is 5 KB (5120 bytes).
> For all other remote notifications, the maximum payload size is 4 KB (4096 bytes).
https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification
---
# 基本的にはどちらも4kbまで
---
# レートリミットはある?🤔
---
# FCM
- XMPP サーバーへの接続
- プロジェクトごとに1分あたり400回
- デバイス1台に対するメッセージレート
- 1分あたり最大240件、1時間あたり5,000件
https://firebase.google.com/docs/cloud-messaging/concept-options?hl=ja
---
# APNs
ドキュメント見つけられず
> There are no caps or batch size limits for using APNs.
---
# ファイルを分割すればいける?🤔
---
# 4KB × 240 = 960KB
---
# 作ってみた - 「プッシュドロップ」
- https://github.com/yicru/push-drop
---
# 終わり