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
600
わいわいSwift PM part 1
d_date
2
490
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
760
Other Decks in Programming
See All in Programming
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
240
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
110
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
970
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1.1k
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
280
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
540
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.4k
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
160
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
110
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
200
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
5.5k
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
130
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
Building Applications with DynamoDB
mza
96
7.2k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
800
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
550
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
250
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
370
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.4k
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
170
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
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