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
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
620
就活成功の秘訣
zoothezoo
0
1.1k
Other Decks in Programming
See All in Programming
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
290
Don't Prompt Harder, Structure Better
kitasuke
0
790
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
120
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
150
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
810
AIと共に生きる技術選定 2026
sgash708
0
110
AI-DLC Deep Dive
yuukiyo
9
4.9k
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
180
tRPCの概要と少しだけパフォーマンス
misoton665
2
240
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
110
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
220
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
30 Presentation Tips
portentint
PRO
1
280
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
350
Unsuck your backbone
ammeep
672
58k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
280
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
What's in a price? How to price your products and services
michaelherold
247
13k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
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