Number: 003, Date: 2024-01-22

2024.01.15 ~ 2024.01.21

🔥 Implementing Firebase Multiple Configuration


When using Firebase services, distinguishing between Dev and Release environments makes it convenient to identify issues or data occurring in the actual Release environment, providing a clear distinction.

There are two ways to distinguish:

  1. Separating the Firebase project itself
    1. You can separate the Firebase project while keeping the BundleID the same.
  2. Separating the iOS app within the Firebase project
    1. Change the BundleID for each Xcode Configuration.

Once the above methods are defined, download each GoogleService-Info.plist and add them without adding to Target Membership, but by connecting and adding them in the Build Phase.

GoogleService-Info.plist addition script

case "${CONFIGURATION}" in
  "Debug" )
cp -r "$SRCROOT/${PROJECT_NAME}/FirebaseConfigurations/Debug/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" ;;
  "Release" )
cp -r "$SRCROOT/${PROJECT_NAME}/FirebaseConfigurations/Release/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" ;;
*)
;;

🙋🏻‍♂️ Other Notes


  1. I learned about a technology called Encoded Polyline, which simplifies unnecessary straight parts when drawing paths and represents them as a single string.
  2. I experienced a failure in modularization.
    • I thought it would be helpful for refactoring to separate global data used in the project into a separate framework and use it under the premise of using global data. However, after applying it, I experienced decreased readability and ended up removing the framework.