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
Propagate Remote Config updates in real time
Search
d_date
November 14, 2018
Programming
1.9k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Propagate Remote Config updates in real time
d_date
November 14, 2018
More Decks by d_date
See All by d_date
TCA Practice in 5 min
d_date
2
1.9k
waiwai-swiftpm-part2
d_date
3
590
わいわいSwift PM part 1
d_date
2
480
What's new in Firebase 2021
d_date
2
1.6k
CI/CDをミニマルに構築する
d_date
1
630
Swift Package centered project - Build and Practice
d_date
20
17k
How to write Great Proposal
d_date
4
2.3k
Thinking about Architecture for SwiftUI
d_date
8
2.5k
Integrate your app to modern world in Niigata
d_date
0
740
Other Decks in Programming
See All in Programming
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
400
The NotImplementedError Problem in Ruby
koic
1
900
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.5k
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
13k
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7k
1B+ /day規模のログを管理する技術
broadleaf
0
110
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
ふつうのFeature Flag実践入門
irof
8
4.1k
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
390
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Typedesign – Prime Four
hannesfritz
42
3.1k
Test your architecture with Archunit
thirion
1
2.3k
Code Review Best Practice
trishagee
74
20k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
610
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Bash Introduction
62gerente
615
220k
HDC tutorial
michielstock
2
720
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Transcript
1SPQBHBUF3FNPUF$POH VQEBUFTJOSFBMUJNF 2018/11/14 Firebase Summit 2018 ใࠂձ @Google Daiki Matsudate
/ @d_date
%BJLJ.BUTVEBUF @d_date
1SPQBHBUF3FNPUF$POH VQEBUFTJOSFBMUJNF
None
/&8 3FNPUF$POHUSJHHFST
functions.remoteConfig.onUpdate(versionMetadata => {});
exports.showConfigDiff = functions.remoteConfig.onUpdate(versionMetadata => { return admin.credential.applicationDefault().getAccessToken() .then(accessTokenObj => {
return accessTokenObj.access_token; }) .then(accessToken => { const currentVersion = versionMetadata.versionNumber; const templatePromises = []; templatePromises.push(getTemplate(currentVersion, accessToken)); templatePromises.push(getTemplate(currentVersion - 1, accessToken)); return Promise.all(templatePromises); }) .then(results => { const currentTemplate = results[0]; const previousTemplate = results[1]; const diff = jsonDiff.diffString(previousTemplate, currentTemplate); console.log(diff); return null; }).catch(error => { console.error(error); return null; }); });
1 4VCTDSJCFDMJFOUBQQ JOTUBODFTUPBO'$.UPQJD
extension AppDelegate : MessagingDelegate { func messaging(_ messaging: Messaging, didReceiveRegistrationToken
fcmToken: String) { Messaging.messaging().subscribe(toTopic: "PUSH_RC") { error in print("Subscribed to PUSH_RC topic") } } }
2 $SFBUFBGVODUJPOUPTFOEBO '$.QJOHPOUFNQMBUFVQEBUFT
import * as functions from 'firebase-functions'; import * as admin
from ‘firebase-admin'; admin.initializeApp(); exports.pushConfig = functions.remoteConfig.onUpdate(versionMetadata => { // Create FCM payload to send data message to PUSH_RC topic. const payload: admin.messaging.MessagingPayload = { data: { 'CONFIG_STATE': ‘STALE' } }; const options: admin.messaging.MessagingOptions = { contentAvailable: true } // Use the Admin SDK to send the ping via FCM. return admin.messaging() .sendToTopic('PUSH_RC', payload, options) .then(resp => { console.log(resp); return null; }); });
{ "aps" : { "content-available" : 1 }, }
None
None
None
None
3 4FUUIF3FNPUF$POH TUBUFPOUIFDMJFOU
// Silent push notification func application(_ application: UIApplication, didReceiveRemoteNotification userInfo:
[AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { print("Entire message \(userInfo)") if let _ = userInfo["CONFIG_STATE"] as? String { UserDefaults.standard.set(true, forKey: "CONFIG_STALE") } completionHandler(.newData) }
4 'FUDIUIF3FNPUF$POH VQEBUFTPOBQQTUBSUVQ
func fetchConfig() { welcomeLabel.text = remoteConfig[loadingPhraseConfigKey].stringValue var expirationDuration = 43200
if remoteConfig.configSettings.isDeveloperModeEnabled || UserDefaults.standard.bool(forKey: "CONFIG_STALE") { expirationDuration = 0 UserDefaults.standard.set(false, forKey: "CONFIG_STALE") } remoteConfig.fetch(withExpirationDuration: TimeInterval(expirationDuration)) { (status, error) -> Void in let alertAction: UIAlertAction = .init(title: "OK", style: .default, handler: nil) if status == .success { print("Config fetched!") self.remoteConfig.activateFetched() } else { print("Config not fetched") print("Error: \(error?.localizedDescription ?? "No error available.")") } self.displayWelcome() } }
%&.0
"OBQQDBOGFUDIBNBYJNVNPGUJNFTJOBNJOVUF $BDIJOHBOEUISPUUMJOH
٥3FNPUF$POHUSJHHFST/08"7"*-"#-& ٥4JMFOU1VTI/PUJDBUJPOXJUIˎDPOUFOUBWBJMBCMFˏ ٥&OBCMFSFBMUJNFVQEBUFXJUI3FNPUF$POHBOE'$. 3FDBQ
٥1VTIJOH6QEBUFTUP:PVS"QQ4JMFOUMZ IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOVTFSOPUJDBUJPOTTFUUJOH@VQ@B@SFNPUF@OPUJDBUJPO@TFSWFS QVTIJOH@VQEBUFT@UP@ZPVS@BQQ@TJMFOUMZ ٥1SPQBHBUF3FNPUF$POHVQEBUFTJOSFBMUJNF IUUQTSFCBTFHPPHMFDPNEPDTSFNPUFDPOHQSPQBHBUFVQEBUFTSFBMUJNF 3FTPVSDFT
None