Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[Online] potatotips #74 iOS/Android開発Tips共有会
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
zoothezoo
June 23, 2021
Programming
1.1k
1
Share
[Online] potatotips #74 iOS/Android開発Tips共有会
date: 2021/6/23 (Wed)
title: 【FCM】Androidの通知設定でハマった話
zoothezoo
June 23, 2021
More Decks by zoothezoo
See All by zoothezoo
Figma Dev Mode MCP Serverを用いたUI開発
zoothezoo
2
610
就活成功の秘訣
zoothezoo
0
1.1k
Other Decks in Programming
See All in Programming
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
事業会社でのセキュリティ長期インターンについて
masachikaura
0
230
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
1
280
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
150
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
690
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
220
Claude Codeログ基盤の構築
giginet
PRO
7
3.9k
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
120
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
310
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
220
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.5k
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
230
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
120
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
310
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
4 Signs Your Business is Dying
shpigford
187
22k
Claude Code のすすめ
schroneko
67
220k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
180
Transcript
【FCM】 Androidの通知設定でハマった話 zoothezoo @zoothezoo_pro [Online] potatotips #74 iOS/Android開発Tips共有会
Kohei Ikezu @zoothezoo_pro CyberAgent, Inc. Tapple, Inc. 2021年 新卒
話すこと - 今回のバグと解決方法 - ちょっとしたTips 話さないこと - 通知の作り方の基本 - FCMに概要など
🤔 Push通知がChannelに正常に割り振られない
Foregroundではちゃんと処理されるがBackgroundの時に 🤔 Push通知がChannelに正常に割り振られない
どうやって振り分けるの? Channel IDをChannelに設定する Push通知にChannel IDを指定する 届く🎉
サーバ FCM Android
通知が届き続けてしまう 例) いいねの通知受け取りをOFFにする Push通知を受信してしまう
Channel 「その他」 - 身に覚えのない「その他」が作成されている - 英語だと “miscellaneous” - 全ての通知が「その他」に割り振られてしまう
知らないChannelが作成されている - NotificationManager.getChannels() - 全てのチャンネルを取得 - 登録済みチャンネルの1つに 右のようなものがある - fcm_fallback
_notification_channel??
なぜ作成されるか? > 受信メッセージで通知チャネルが明示的に設定されていない場合、 > FCM では常にこの値が使用されます。 どうやらChannel IDが 明示的に設定されていないらしい
データメッセージと通知メッセージ データメッセージ - クライアントで処理 - コールバック関数で処理 About FCM messages |
Firebase 通知メッセージ - FCM SDKで自動処理 - BGでは通知トレイで受信 - FGではコールバック関数にて処理
今回のケースの解決方法 - Push通知をBackgroundで受け取りたいには通知メッセージ - key-valueの形式にてchannelIdを指定する - できる🎉
tips: 自分で設定する - 予期せぬChannel IDが来る場合 - タイポなど - 自分で名前を設定できます -
その他, OTHER etc. AndoidManifest.xml Set up a Firebase Cloud Messaging client app on Android
tips: ChannelがOFFの状態を知りたい - ON/OFFを知れる関数はなさそう - 🔑 IMPORTANCE_NONE - デフォルトで通知OFFにしたいcreate する時点で設定
Create and Manage Notification Channels How can I know programmatically if a notification channel is enabled on Android O?
まとめ - サーバからChannel IDを指定する - Push通知を送るときは通知メッセージ - ドキュメントを読み込もう @zoothezoo_pro