Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Remote Configを導入して、Notificationsは導入しませんでした
Search
Ryo Sakaguchi
July 13, 2016
Technology
1.4k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Remote Configを導入して、Notificationsは導入しませんでした
Remote ConfigとNotificationとAnalyticsに関してさくっと話しました。
Otemachi_firebase #1
Ryo Sakaguchi
July 13, 2016
More Decks by Ryo Sakaguchi
See All by Ryo Sakaguchi
なんとなくgRPC-Java を使ってるそこの俺、gRPC-Kotlin に移行したらどうだ?
wakwak3125
0
27
Android Architecture Componentsを使って、改善・効率化するAndroidアプリ開発
wakwak3125
0
1.4k
Test multiple APKs with Robolectric
wakwak3125
0
840
Clip, Elevation and ViewOutlineProvider
wakwak3125
1
1.4k
WebView as Fancy and effective View
wakwak3125
1
1.7k
ViewPager2をちょっとさわってみよう
wakwak3125
0
1.7k
年末だし、振り返るKotlin
wakwak3125
1
1.2k
社内ライブラリのアップデートフロー
wakwak3125
4
3.9k
Wantedly Peopleのリリースフロー
wakwak3125
1
4.9k
Other Decks in Technology
See All in Technology
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
180
Metadata - Section 1: HTML Basics
mohab1
0
130
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
300
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
710
今さら理解するウェブフォントver.2026
takanorip
3
940
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
310
「私が一番顧客に詳しい」を捨てる~ 全員が一次情報に精通する開発チームをつくり、PMが次のボトルネックへ染み出すまで
kaminashi
0
130
夫婦で子育てするための育児標準化
codmoninc
PRO
0
480
Turning Repos into the Product Second Brain with an LLM Wiki
linedevth
0
100
古い指輪から広がった JAVA コミュニティ とのつながり
yamad
0
130
Classmethod Company Deck
satoshi7
1
750
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
120
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
The Language of Interfaces
destraynor
162
27k
How to train your dragon (web standard)
notwaldorf
96
6.9k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
HDC tutorial
michielstock
2
960
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
It's Worth the Effort
3n
188
29k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
Transcript
Remote ConfigΛಋೖͯ͠ɺ Notificationsಋೖ͠·ͤΜͰͨ͠ɻ @wakwak3125 Otemachi Firebase #1
About me ɾࡔޱ ྒʢ͔͙ͪ͞ Γΐ͏ʣ ɾLang-8ͱ͍͏ձࣾͰಇ͍͍ͯ·͢ɻ ɾҰࡢ·ͰՈ۩ͷൢചһΛ͍ͯ͠·ͨ͠ ɾձࣾTwitterͰΘ͘Θ͘͞ΜͱݺΕ͍ͯ·͢
HiNativeʢϋΠωΠςΟϒʣ commitϝοηʔδΛఴͯ͠Β͏ͷΦεεϝͰ͢
Agenda • What’s Remote Config • What’s Notifications • Remote
Config, Pros/Cons • Notifications, Pros/Cons • Analytics with Remote Config
What’s Remote Config?
What’s Remote Config? • ΦϯϥΠϯ্Ͱઃఆͨ͠Λଈ࠲ʹΞϓϦʹಧ͚Δ ͜ͱ͕Ͱ͖Δπʔϧ • A/BςετͷͨΊʹͬͯΈͨΓ • ηάϝϯτຖʹΞϓϦͷڍಈΛ͔͑ͨΓ
• มߋΛΞϓϦͷΞοϓσʔτͳ͠ʹөͤͨ͞Γ • ͋ΔػೳΛ༗ޮԽͨ͠ΓແޮԽͨ͠Γ
Chang the behavior by segments. • ಛఆͷϢʔβʔ͞ΜͷΈʹԿ͔Λද͍ࣔͤͨ͞ • ϨϏϡʔૌٻμΠΞϩά •
ϔϏʔϢʔβʔ͚ͷ͝Ҋ
How to use Remote Config ?
Step1 FirebaseͷґଘؔΛՃ // Add dependencies to app/build.gradle compile 'com.google.firebase:firebase-core:9.2.0' compile
‘com.google.firebase:firebase-config:9.2.0' // Create singleton Remote Config object remoteConfig = FirebaseRemoteConfig.getInstance() val configSettings = FirebaseRemoteConfigSettings.Builder() .setDeveloperModeEnable(BuildConfig.DEBUG).build() remoteConfig.setConfigSettings(configSettings)
Step2 σϑΥϧτΛઃఆ // Create default parameter like this. res/xml/remote_config_default_params.xml <defaultsMap>
<entry> <key>show_review_dialog</key> <value>false</value> </entry> </defaultsMap> // set default parameters by “setDefaults()” remoteConfig = FirebaseRemoteConfig.getInstance() remoteConfig.setDefaults(R.xml.remote_config_default_params)
Step3 ύϥϝʔλʔΛRemote ConfigαʔόʔʹConsole͔Β ઃఆ (Review targetʹ͍ͭͯޙड़)
Step4 αʔόʔ͔ΒΛऔಘ // Fetch the parameter from server. override fun
onPostResume() { super.onPostResume() // cacheExpireΛ։ൃ࣌0ʹ͢Δͱɺͷมߋͷ֬ೝΛ͘͢͠ͳΓ·͢ɻ val cacheExpire: Long = 3600L remoteConfig.fetch(cacheExpire) .addOnFailureListener({ Log.d(TAG, "Failure") }) .addOnSuccessListener ({ // औಘͨ͠ύϥϝʔλʔΛ༗ޮԽ͢Δɻ remoteConfig.activateFetched() }) .addOnCompleteListener({ Log.i(TAG, "Complete") })}
Step5 औಘͨ͠ΛͬͯԿ͔͢Δ // Fetch the parameter from server. // Ұऔಘͨ͠Ωϟογϡ͞ΕΔͷͰɺfetch͢Δඞཁͳ͍ɻ
if (remoteConfig.getBoolean(“show_review_dialog”)) { showReviewDialog() }
Point • ެࣜͷυΩϡϝϯτʹॻ͍ͯ͋Γ·͕͢ɺdeveloper modeΛ༗ޮԽ͠ͳ͍ ͱɺfetchճʹ੍ݶ͕ઃఆ͞ΕΔͨΊɺඞͣ༗ޮԽ͠·͠ΐ͏ɻ • ͷfetchεϓϥογϡɺॳճىಈ࣌ʹ·ͱΊͯऔಘ͓͖ͯ͠ɺऔಘՄ൱Λ ࣋ͬͯࠓޙ࠶fetch͢Δ͔Ͳ͏͔Λஅ͢Εྑ͍ͱࢥ͍·͢ɻ • ͦͯ͠fetch()Αࣦ͘ഊ͠·͢ɻ·ͨɺonCreateͰݺͿͱ͔ͳΓͷ֬Ͱࣦ
ഊɺ·ͨηοτ͍ͯ͠ΔOnCompleteListener͕ݺΕ·ͤΜͰͨ͠ɻ work around ͱͯ͠ onPostResumeͰfetchͯ͋͛͠Δ͜ͱͰྑͦ͞͏Ͱ͢ɻ • Ref: http://stackoverflow.com/questions/37501124/firebaseremoteconfig- fetch-does-not-trigger-oncompletelistener-every-time
What’s Notifications ?
What’s Notifications ? • FirebaseͷGROWηΫγϣϯʹҐஔ͚ΒΕ͍ͯΔλʔήςΟ ϯάՄೳͳϓογϡϝοηʔδ৴πʔϧ • ϓογϡ௨ͷ։෧ଌఆ • ϓογϡ௨։෧ޙͷίϯόʔδϣϯΠϕϯτͷଌఆ
• ηάϝϯτ͝ͱʹ৴Մೳ • ΞϓϦͷར༻ଅਐʹͭͳ͕Δ • ϓογϡϝοηʔδૹΓϗʔμΠ
Versatile message targeting. • Analyticsͱͷ࿈ܞͰ͍ΖΜͳλʔήοτ͚ʹϓογϡΛ৴Ͱ͖·͢ɻ • ຊޠֶशऀ͚ʹຊจԽʹؔ͢Δ໘നͦ͏ͳ࣭Λ৴ͨ͠Γ • αϒεΫϦϓγϣϯϓϥϯͷηʔϧΛʮҎલαϒεΫϦϓγϣϯొΛ ͍͕ͯͨ͠ղͯ͠͠·ͬͨਓʯʹ͓Βͤͨ͠Γ…
• Console͔ΒखܰʹϓογϡϝοηʔδΛ࡞Δ͜ͱ͕Ͱ͖ΔͷͰɺඇ։ൃ ऀͷΞϧόΠτ͞Μʹ͓ئ͍͢Δ͜ͱ͕Ͱ͖Δɻ • Analytics࿈ܞͰͲΜͳϢʔβʔʹ৴Ͱ͖Δͳ͊ศརͦ͏ͩͳͱࢥͬͯ ಋೖ
͠Α͏ͱࢥ͍·͕ͨࣙ͠Ί·ͨ͠
Why…? • ΞϓϦ͕ϑΥΞάϥϯυͷ࣌͡Όͳ͍ͱɺConsoleͰ࡞ͬͨϓογϡ௨ͷΞ ΠίϯσʔλΛΧελϚΠζ͢Δ͜ͱ͕Ͱ͖ͳ͔ͬͨͨΊࣙΊͪΌ͍·ͨ͠… • ΞϓϦΛόοΫάϥϯυʹ͍ͯ͠Δਓୡ(જࡏతͳϢʔβʔ͞Μୡ)ΛΞϓϦ ʹͬͯͤ͜͞ΔͨΊʹ͍͔͕ͨͬͨɺཁ݅Λຬͨ͢͜ͱ͕Ͱ͖ͳ͔ͬͨɻ • όοΫάϥϯυঢ়ଶͰɺΞϓϦΛىಈͤ͞Δ͚ͩͰ͖Δ͕ɺͦΕͰΞ ΠίϯͷઃఆͳͲΛConsoleͰͰ͖ͳ͍ͷ͢͜͠ࠔΔͨΊɻ
• ଞʹແྉͰྑ͍αʔϏεΛݟ͚ͭͨɻ • OneSignalͱ͍͏αʔϏε͕ߴػೳ͔ͭૹΓϗʔμΠͰྑ͔ͬͨͰ͢ɻ
Use Remote Config with Firebase Analytics !
Use Remote Config with Analytics • Remote Config͋͘·Ͱɺαʔόʔ͔ΒΛओ มߋͨ͠Γ͢ΔͨΊ͚ͩͷπʔϧɻมߋޙͷӨڹ ԠΛݟΔͨΊʹूܭ࡞ۀ͕ඞཁɻͦ͜·Ͱ
Remote Config͚ͩͰͰ͖·ͤΜɻ • ·ͨɺηάϝϯτΛߜͬͨมߋͷద༻୯ମͰ Ͱ͖·ͤΜɻ
Set up(1/6) • ઌʹઆ໌͍ͯͨ͠ϨϏϡʔૌٻμΠΞϩάΛྫʹઆ ໌͍ͨ͠ͱࢥ͍·͢ɻ • ϨϏϡʔΛॻ͍ͯ΄͍͠ϢʔβʔͷଐੑΛܾΊΔɻ ྫ͑…(HiNativeͷ߹) • ࣭ճ͕10ճҎ্ͷϢʔβʔ͞Μʹରͯ͠Ϩ
ϏϡʔૌٻΛߦ͍ͬͯ·͢ɻ
Set up(2/6) • ଐੑ͕ܾ·ͬͨΒɺ࣍ͦͷϢʔβʔଐੑΛ Analyticsʹઃఆͯ͋͛͠·͠ΐ͏ɻ • ࠓճ͜Μͳײ͡ʹͯ͠Έ·ͨ͠ɻ
Set up(3/6) • ઌ΄Ͳ࡞ͬͨϓϩύςΟΛݩʹΦʔσΟΤϯεΛ࡞ ͠·͢ɻ
Set up(4/6) ࠷ޙʹɺΞϓϦଆ͔ΒϢʔβʔϓϩύςΟΛૹ ৴͠·͢ɻ // ϨϏϡʔରϢʔβʔͷ࣭ͷ͖͍͠ // ͜͜ͷɺRemoteConfigͰઃఆ͓͚ͯ͠ɺϨϏϡʔରʹ͢ΔϢʔβʔͷ࣭ Λ͍ͭͰม͑Δ͜ͱ͕Ͱ͖·͢ɻ val
threshold = 10 // numberOfQuestionsΞϓϦΛ༻͍ͯ͠ΔϢʔβʔͷ࣭ val reviewTarget = (numberOfQuestions >= threshold).toString() // Firebase AnalyticsʹϢʔβʔϓϩύςΟΛૹ৴ firebaseAnalytics.setUserProperty(“review_target”, reviewTarget)
Set up(5/6) • Analyticsʹઃఆͨ͠ϓϩύςΟΛݩʹɺRemote Config ʹ݅ΛՃ͠·͢ɻ
Set up(6/6) • Remote Configͷύϥϝʔλʔʹ݅Λద༻͠·͢ɻ ݅ͷΛՃ -> Review targetΛબ
͕࣌ؒΞϨ͢͜ͱ • Remote Configͬͯͯؾ͍ͮͨ͜ͱͱ͔ • A/BςετάϧʔϐϯάͳͲ͕Ͱ͖ͳ͍ͷͰɺҰ࿈ͷྲྀΕͳͲΛςετ͢Δ߹ͪΐͬͱ͕͋Δɻʢνϡʔ τϦΞϧͷҰ࿈ͷςΩετͷςετʣ • ύοͱࢥ͍͍ͭͨͷɺRemote Configͷʹจࣈͷ੍ݶ͕΄΅΄΅ແ͍ͷͰɺJSONͳΜ͔ΛೖΕ͓͍ͯ
ͯɺͦΕΛύʔεͯ͠͏Α͏ʹ͢Εɺॊೈʹมߋ͔ͭάϧʔϐϯά͕Ͱ͖ΔΜ͡Όͳ͍͔ͳͱࢥ͍·ͨ͠ɻ • FirebaseશମΛ௨ͯ͠ࢥͬͨ͜ͱ • Lang-8ͷΑ͏ͳখنͳձࣾ(5ਓن)ͱ͔ͩͱɺͯ͢Λࣗࣾ։ൃͰಠࣗʹ͍ͬͯΔͱ͍͘Β͕࣌ؒ͋ͬͯ Γͳ͍ͷͰɺ͜͏͍ͬͨϫϯετοϓͰ͍Ζ͍ΖͰ͖Δπʔϧඇৗʹॿ͔Δͳ͊ͱ͍͏ҹͰͨ͠ɻ • ͔͠ແྉɻ • ͍Ζ͍Ζফͤͳ͍ɻ • Ճͨ͠ΞϓϦ͕ফͤͳ͍ • Ճͨ͠ϓϩύςΟফͤͳ͍ • σϑΥϧτͰ༻ҙ͞Ε͍ͯΔͷফͤͳ͍ • ͱʹ͔͘ফͤͳ͍
͋Γ͕ͱ͏͍͟͝·ͨ͠