From 2759955173ec09e0fd367270e755c441379cee78 Mon Sep 17 00:00:00 2001 From: Quan Pham Date: Wed, 18 Jan 2023 13:55:47 -0800 Subject: [PATCH 1/3] Point Podfile to dev branch and use Realtime in Sample App --- .../RemoteConfigViewController.swift | 20 ++++++++ config/GoogleService-Info.plist | 48 ++++++++----------- config/Podfile | 5 +- 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/config/ConfigExample/RemoteConfigViewController.swift b/config/ConfigExample/RemoteConfigViewController.swift index c73886e00..1568e3ee3 100644 --- a/config/ConfigExample/RemoteConfigViewController.swift +++ b/config/ConfigExample/RemoteConfigViewController.swift @@ -70,6 +70,26 @@ class RemoteConfigViewController: UIViewController { let settings = RemoteConfigSettings() settings.minimumFetchInterval = 0 remoteConfig.configSettings = settings + + remoteConfig.add { RemoteConfigUpdate, Error in + guard Error == nil else { + DispatchQueue.main.async { + self.displayError(Error) + } + return + } + self.remoteConfig.activate() { changed, error in + guard error == nil else { + DispatchQueue.main.async { + self.displayError(error) + } + return + } + DispatchQueue.main.async { + self.updateUI() + } + } + } } /// Fetches and activates remote config values diff --git a/config/GoogleService-Info.plist b/config/GoogleService-Info.plist index d8f7b53bb..8b7e57731 100644 --- a/config/GoogleService-Info.plist +++ b/config/GoogleService-Info.plist @@ -2,39 +2,33 @@ - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + 1039810801566-jgl63pdueptjd68273smr00gbemki5pg.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.1039810801566-jgl63pdueptjd68273smr00gbemki5pg API_KEY - AIzaSyAzlj4APqi5S58nFtE52Da0fYBOHA2MhaY + AIzaSyCt4y1e58vCnQ9NBu3VaHOdGtJ0PJu79a4 + GCM_SENDER_ID + 1039810801566 + PLIST_VERSION + 1 BUNDLE_ID com.google.firebase.quickstart.ConfigExample - CLIENT_ID - 123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com - DATABASE_URL - https://mockproject-1234.firebaseio.com - GCM_SENDER_ID - 123456789000 - GOOGLE_APP_ID - 1:123456789000:ios:f1bf012572b04063 + PROJECT_ID + realtimeconfig-donotdelete + STORAGE_BUCKET + realtimeconfig-donotdelete.appspot.com IS_ADS_ENABLED - + IS_ANALYTICS_ENABLED - + IS_APPINVITE_ENABLED - + IS_GCM_ENABLED - + IS_SIGNIN_ENABLED - - PLIST_VERSION - 1 - PROJECT_ID - mockproject-1234 - REVERSED_CLIENT_ID - com.googleusercontent.apps.123456789000-hjugbg6ud799v4c49dim8ce2usclthar - STORAGE_BUCKET - mockproject-1234.appspot.com + + GOOGLE_APP_ID + 1:1039810801566:ios:7a7902c92c2883886cf08f - + \ No newline at end of file diff --git a/config/Podfile b/config/Podfile index 67a7e6ca2..7d115b4c3 100644 --- a/config/Podfile +++ b/config/Podfile @@ -6,8 +6,9 @@ target 'ConfigExample' do use_frameworks! # Pods for ConfigExample - pod 'FirebaseRemoteConfig' - pod 'FirebaseRemoteConfigSwift', "> 8.12-beta" + pod 'FirebaseRemoteConfig', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'realtime-rc-merge' + pod 'FirebaseRemoteConfigSwift', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'realtime-rc-merge' + pod 'FirebaseAnalytics' target 'ConfigExampleTests' do inherit! :search_paths From 47d92f5f5f41f06f048b322659b8edeb35142115 Mon Sep 17 00:00:00 2001 From: Quan Pham Date: Wed, 18 Jan 2023 14:07:57 -0800 Subject: [PATCH 2/3] Return plist --- config/GoogleService-Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/GoogleService-Info.plist b/config/GoogleService-Info.plist index 8b7e57731..a93a07e95 100644 --- a/config/GoogleService-Info.plist +++ b/config/GoogleService-Info.plist @@ -31,4 +31,4 @@ GOOGLE_APP_ID 1:1039810801566:ios:7a7902c92c2883886cf08f - \ No newline at end of file + From 6946dedd1c9aeb8662ff7c9a6bbd6d0d6731e36f Mon Sep 17 00:00:00 2001 From: Quan Pham Date: Thu, 19 Jan 2023 15:11:41 -0800 Subject: [PATCH 3/3] Add extra logging --- config/ConfigExample/RemoteConfigViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/ConfigExample/RemoteConfigViewController.swift b/config/ConfigExample/RemoteConfigViewController.swift index 1568e3ee3..a9fa049e8 100644 --- a/config/ConfigExample/RemoteConfigViewController.swift +++ b/config/ConfigExample/RemoteConfigViewController.swift @@ -72,12 +72,18 @@ class RemoteConfigViewController: UIViewController { remoteConfig.configSettings = settings remoteConfig.add { RemoteConfigUpdate, Error in + NSLog("Received Realtime Signal") guard Error == nil else { DispatchQueue.main.async { self.displayError(Error) } return } + + if (RemoteConfigUpdate?.updatedKeys.contains("realtime_rc_changed_params") != nil) { + NSLog("Received realtime_rc_changed_params") + } + self.remoteConfig.activate() { changed, error in guard error == nil else { DispatchQueue.main.async {