In new Firebase, how to use multiple config file in xcode?

后端 未结 9 1583
被撕碎了的回忆
被撕碎了的回忆 2021-01-30 09:14

Hey I am playing with the new firebase iOS SDK, in my project, I have only one target, I created two configurations, Debug and Release, with different bundler identifier, but se

9条回答
  •  猫巷女王i
    2021-01-30 09:19

    I did store 2 GoogleService-Info with different names:

    • GoogleService-Info.plist for production
    • GoogleService-Info-Debug.plist for development

    And then go to Build Phases, add new run script:

    if [ "${CONFIGURATION}" == "Release" ]; then
    cp -r "${PROJECT_DIR}/PathToYourGoogleServiceInfoFile/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
    
    echo "Production plist copied"
    
    elif [ "${CONFIGURATION}" == "Debug" ]; then
    
    cp -r "${PROJECT_DIR}/PathToYourGoogleServiceInfoFile/GoogleService-Info-Debug.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
    
    echo "Development plist copied"
    fi
    

提交回复
热议问题