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
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
610
就活成功の秘訣
zoothezoo
0
1.1k
Other Decks in Programming
See All in Programming
AI活用のコスパを最大化する方法
ochtum
0
130
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
380
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
130
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
550
文字コードの話
qnighy
44
17k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
370
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
480
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.3k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
150
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
420
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
Designing for Timeless Needs
cassininazir
0
160
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
270
Mind Mapping
helmedeiros
PRO
1
110
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
210
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
130
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
How STYLIGHT went responsive
nonsquared
100
6k
What does AI have to do with Human Rights?
axbom
PRO
1
2k
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