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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
170
The free-lunch guide to idea circularity
hollycummins
0
410
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
130
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
120
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
3
380
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
5
2.5k
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
520
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
150
アーキテクチャモダナイゼーションとは何か
nwiizo
12
2.8k
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.5k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Exploring anti-patterns in Rails
aemeredith
3
310
Build your cross-platform service in a week with App Engine
jlugia
234
18k
It's Worth the Effort
3n
188
29k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
320
Designing Powerful Visuals for Engaging Learning
tmiket
1
320
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
160
A Modern Web Designer's Workflow
chriscoyier
698
190k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
330
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