There is a Apps with Multiple Environments section in Fabric Crashlytics Advanced Setup that suggests to use a separate organization for each version.
I have created 3 separate organizations per each Build configuration:
- MyApp
- MyApp (Debug)
- MyApp (AdHoc)
I've got a conditional in my Run Script Build Phase that runs the Fabric framework script with different API Keys and Build Secrets and I can confirm that the conditional is being hit right, but I still do not get the API Keys updated in my plist (which I'm guessing Fabric uses). It seems like Fabric is sending my crashes to the last API key / organization that I on-boarded using the Fabric app. Is there something I'm missing? I know I can use [Crashlytics initWithApiKey:@""]
, but from what I've read this is considered legacy code.
Here is my Run Script Build Phase:
if [ "${CONFIGURATION}" = "Distribution" ]; then
echo "Building Fabric for Distribution."
./Fabric.framework/run dist_api_key dist_build_secret
fi
if [ "${CONFIGURATION}" = "AdHoc" ]; then
echo "Building Fabric for AdHoc."
./Fabric.framework/run adhoc_api_key adhoc_build_secret
fi
if [ "${CONFIGURATION}" = "Debug" ]; then
echo "Building Fabric for Debug."
./Fabric.framework/run debug_api_key debug_build_secret
fi
The original Q/A