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
俺が考える最強のPush Receiver
Search
hayashi hirotake
August 28, 2018
Technology
0
180
俺が考える最強のPush Receiver
FCMとReproを共存させるためにちょっと考えてみた
hayashi hirotake
August 28, 2018
Tweet
Share
More Decks by hayashi hirotake
See All by hayashi hirotake
第2回カスタマー系エンジニア座談会
hiroxy
0
390
Monaca UG Conference 2019
hiroxy
0
27
Career Kaigi 2019
hiroxy
0
53
Repro Tech Meetup #CRE
hiroxy
2
790
Intercom Kickoff
hiroxy
0
370
Other Decks in Technology
See All in Technology
次世代KYC活動報告 / 20250219-BizDay17-KYC-nextgen
oidfj
0
150
データ資産をシームレスに伝達するためのイベント駆動型アーキテクチャ
kakehashi
PRO
2
470
ビジネスモデリング道場 目的と背景
masuda220
PRO
9
410
なぜ私は自分が使わないサービスを作るのか? / Why would I create a service that I would not use?
aiandrox
0
510
Oracle Cloud Infrastructure:2025年2月度サービス・アップデート
oracle4engineer
PRO
1
140
2024.02.19 W&B AIエージェントLT会 / AIエージェントが業務を代行するための計画と実行 / Algomatic 宮脇
smiyawaki0820
10
1.5k
Platform Engineeringは自由のめまい
nwiizo
4
2k
10分で紹介するAmazon Bedrock利用時のセキュリティ対策 / 10-minutes introduction to security measures when using Amazon Bedrock
hideakiaoyagi
0
180
飲食店予約台帳を支えるインタラクティブ UI 設計と実装
siropaca
7
1.6k
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
880
Data-centric AI入門第6章:Data-centric AIの実践例
x_ttyszk
1
390
ハッキングの世界に迫る~攻撃者の思考で考えるセキュリティ~
nomizone
13
5k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Fireside Chat
paigeccino
34
3.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Facilitating Awesome Meetings
lara
51
6.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
99
18k
Building an army of robots
kneath
302
45k
Transcript
REPRO TECH MEETUP #2 Navigate : Space / Arrow Keys
| - Menu | - Fullscreen | - Overview | - Blackout | - Speaker | - Help M F O B S ? 1 / 37
INTRO @hiroxyy_ hiroxyy Repro CRE Team Leader 3名 Technical
Support Main: Android(半年ちょい) [ GitPitch @ github/hiroxyy/slides ] 2 / 37
最近こんな問い合わせが ありました [ GitPitch @ github/hiroxyy/slides ] 3 /
37
FCMを既に使っていて ReproのPushを受信するためには どうしたらいいですか? [ GitPitch @ github/hiroxyy/slides ]
4 / 37
よしなに実装して まじで ほんとに 頼むから [ GitPitch @ github/hiroxyy/slides ]
5 / 37
そんなCREイケてないよね [ GitPitch @ github/hiroxyy/slides ] 6 /
37
イケてるCREに僕はなりたい [ GitPitch @ github/hiroxyy/slides ] 7 /
37
作っちゃおう [ GitPitch @ github/hiroxyy/slides ] 8 /
37
俺が考える最強の Push Receiver [ GitPitch @ github/hiroxyy/slides ] 9
/ 37
余談なんですがPUSHのサービス [ GitPitch @ github/hiroxyy/slides ] 10 / 37
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
Repro Amazon Simple Notification Service mobile backend Appvisor push CORE PUSH Growth Push Kii Cloud Urban Airship PushWoosh MAJIN [ GitPitch @ github/hiroxyy/slides ] 11 / 37
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
OneSignal pushnate push7 LOGBASE batch Braze kumulos SWRVE Upsight Accengage [ GitPitch @ github/hiroxyy/slides ] 12 / 37
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
Catapush Mapp Leanplum OneSignal Intercom Pusher Carnival.io PushBots Localytics Kahuna [ GitPitch @ github/hiroxyy/slides ] 13 / 37
1. 2. 3. Taplytics Mixpanel StreetHawk [ GitPitch @ github/hiroxyy/slides
] 14 / 37
めっちゃある [ GitPitch @ github/hiroxyy/slides ] 15 /
37
自分好みのサービス探すのも 面白そう [ GitPitch @ github/hiroxyy/slides ] 16 /
37
余談終わり [ GitPitch @ github/hiroxyy/slides ] 17 / 37
れっつら最強RECEIVER! [ GitPitch @ github/hiroxyy/slides ] 18 / 37
の前に AndroidのPushについて 簡単におさらい [ GitPitch @ github/hiroxyy/slides ] 19
/ 37
ANDROIDのPUSH表示処理 1. ブロードキャストされたintentを BroadcastReceiverで受信 intentに含むキーによって、Data Messageと Notification Messageの2つに分類される 2. 受信したintentをReceiverでハンドリングし、
端末上に表示 [ GitPitch @ github/hiroxyy/slides ] 20 / 37
AndroidManifest.xml 01 // Firebase Push Service 02 <service 03 android:name=".MyFirebaseMessagingService">
04 <intent-filter> 05 <action android:name="com.google.firebase.MESS 06 </intent-filter> 07 </service> 08 09 // Repro Push Receiver 10 <receiver 11 android:name="com.hiroxy.multipushapp.MyGCMReceive [ GitPitch @ github/hiroxyy/slides ] 21 / 37
FCM Repro Notification Message FG:◯ BG:✕ FG:◯ BG:◦ Data Message
FG:◯ BG:◦ FG:◯ BG:◦ FCM Serviceと Repro Receiverの比較 [ GitPitch @ github/hiroxyy/slides ] 22 / 37
いい感じにハンドリングしないと、 FCMとREPRO両方に処理されて端末上 で同じPUSHが2通とか出ちゃう! [ GitPitch @ github/hiroxyy/slides ]
23 / 37
たまにそういうアプリあ、、、 [ GitPitch @ github/hiroxyy/slides ] 24 / 37
どうしたら良さそうか? [ GitPitch @ github/hiroxyy/slides ] 25 /
37
FirebaseMessagingServiceでは ハンドリングできないmessageがある Repro Receiverを使うのが良さそう [ GitPitch @ github/hiroxyy/slides ]
26 / 37
MyGCMReceiver.java 01 package com.hiroxy.multipushapp; 02 03 … 04 05 public
class MyGCMReceiver extends BroadcastReceiver { 06 07 private static final String TAG = "GCMReceiver"; 08 09 @Override 10 public void onReceive(Context context, Intent inte 11 中身を確認 [ GitPitch @ github/hiroxyy/slides ] 27 / 37
INTENT比較 FCMからのPush(notification message)のintent 01 google.c.a.udt:0 02 google.sent_time:1535343208004 03 google.ttl:2419200 04
gcm.notification.e:1 05 google.c.a.c_id:5316713855114895493 06 google.c.a.ts:1535343208 07 gcm.notification.title:From FCM //titleっぽい 08 gcm.n.e:1 09 from:918839616658 10 google.message_id:0:1535343208043592%c3f2cc90c3f2cc90 11 gcm.notification.body:fcm notification message from hi [ GitPitch @ github/hiroxyy/slides ] 28 / 37
ReproからのPush(data message)のintent 01 google.sent_time:1535339920264 02 google.ttl:2419200 03 body:data message from
hiroxyy // 定義したkey 04 from:918839616658 05 repro:n3ylk7yd // repro独自のkey 06 title:From Repro // 定義したkey 07 google.message_id:0:1535339920272127%c3f2cc90f9fd7ecd 08 google.priority:normal [ GitPitch @ github/hiroxyy/slides ] 29 / 37
MyGCMReceiver.java 01 package com.hiroxy.multipushapp; 02 03 … 04 05 public
class MyGCMReceiver extends BroadcastReceiver { 06 07 private static final String TAG = "GCMReceiver"; 08 09 @Override 10 public void onReceive(Context context, Intent inte 11 中身を確認 [ GitPitch @ github/hiroxyy/slides ] 30 / 37
全部のメッセージをハンドリングする RECEIVERを作るとなかなかカオス [ GitPitch @ github/hiroxyy/slides ] 31
/ 37
notificationもdataもやることは一緒 カスタマイズ性の高いdata messageだけを 利用するようにした方がReceiverの処理を スッキリ書けそう となると、FirebaseMessagingServiceを 利用するのもあり [ GitPitch @
github/hiroxyy/slides ] 32 / 37
利用するMESSAGEやサービス毎に RECEIVERを作ったほうが良さそう? [ GitPitch @ github/hiroxyy/slides ] 33 /
37
FIREBASEのようにSERVICEで ハンドリングするようにするのは どうだろう? [ GitPitch @ github/hiroxyy/slides ] 34
/ 37
最強にはまだまだ遠かった! [ GitPitch @ github/hiroxyy/slides ] 35 /
37
これからも良いアプリ設計を 提案できるように頑張ってこう! [ GitPitch @ github/hiroxyy/slides ] 36
/ 37
おわり ありがとうございました! [ GitPitch @ github/hiroxyy/slides ] 37 /
37