Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[Online] potatotips #74 iOS/Android開発Tips共有会
Search
zoothezoo
June 23, 2021
Programming
1
1.1k
[Online] potatotips #74 iOS/Android開発Tips共有会
date: 2021/6/23 (Wed)
title: 【FCM】Androidの通知設定でハマった話
zoothezoo
June 23, 2021
Tweet
Share
More Decks by zoothezoo
See All by zoothezoo
Figma Dev Mode MCP Serverを用いたUI開発
zoothezoo
2
580
就活成功の秘訣
zoothezoo
0
1.1k
Other Decks in Programming
See All in Programming
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
160
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
140
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
210
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
160
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
640
Cap'n Webについて
yusukebe
0
150
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
360
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
430
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
170
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
630
TestingOsaka6_Ozono
o3
0
180
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
210
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
0
96
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
KATA
mclloyd
PRO
33
15k
How to make the Groovebox
asonas
2
1.8k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
66
Designing Powerful Visuals for Engaging Learning
tmiket
0
190
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
200
HDC tutorial
michielstock
0
280
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