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
The Less-Told Story of Socket Timeouts
coe401_
3
670
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
230
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
680
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.7k
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.7k
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
990
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
490
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
430
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
380
AIエージェントで業務改善してみた
taku271
0
550
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
120
How Swift's Type System Guides AI Agents
koher
0
310
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
270
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
780
The World Runs on Bad Software
bkeepers
PRO
72
12k
Believing is Seeing
oripsolob
1
120
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Un-Boring Meetings
codingconduct
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