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:
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" ;;
*)
;;