Considering a normal way to achieve the above goal, I definitely need backend API and deploy backend changes when I decide to open/close the room again. Firebase Remote Config will make it much easier.
Main steps to integrate Firebase Remote Config into the demo
- Install Firebase/Core and Firebase/RemoteConfig
- Add parameters through Remote Config panel in Firebase console
- Click Publish Changes
- Create RemoteConfigService
- Call fetchRemoteValues in Login page and show the message when isShutdown is true
- Try change parameters in Firebase console, the app should behave differently as expected if everything is correct.
There is a famous discussion around remote config loading strategies which covers the cache period and refresh mechanism. https://firebase.googleblog.com/2017/01/firebase-remote-config-loading.html
In my demo, I do need fetch the remote value every time guest visits the Login page, so I adopted strategy 2 with the implementation of loading view.
All chapters:
Realtime chat iOS demo (1) - Firebase Realtime Database
Realtime chat iOS demo (2) - Firebase Remote Config
Realtime chat iOS demo (3) - Firebase Cloud Storage
Realtime chat iOS demo (4) - Firebase Cloud Function
Realtime chat iOS demo (5) - Firebase Cloud Messaging
Source code:
TarotChatRoom in Github
All chapters:
Realtime chat iOS demo (1) - Firebase Realtime Database
Realtime chat iOS demo (2) - Firebase Remote Config
Realtime chat iOS demo (3) - Firebase Cloud Storage
Realtime chat iOS demo (4) - Firebase Cloud Function
Realtime chat iOS demo (5) - Firebase Cloud Messaging
Source code:
TarotChatRoom in Github
No comments:
Post a Comment