As you may recall from a previous class exercise, we had you build out the PriceCheck app using a static JSON file and a helper function from @twostraws. That code has now gone away and we want to get the data from an actual online source. This is the starter code for a version of PriceCheck that uses Firebase to retrieve data. Most of the code is here and ready to run, but to make it work, you will need to:
-
Add Firebase via Swift Package Manager. Be sure to add
Firebase
as well asFirebaseFirestore
andFirebaseFirestoreSwift
. -
Add the
GoogleService-Info.plist
file that was provided on Slack. -
Make sure that those modules are added to both the
PriceCheckFBApp
and theLocationRepository
. -
Fix the code in
LocationRepository
so that it can retrieve the data from this Firestore instance. (See comments provided; the BookManager example could also be helpful here.)
If this is all done correctly, when you build the project, it should properly populate from Firestore and build an app with the same output as the last PriceCheck exercise.