Phase 2 of multi-environment setup. Adds Firebase core, Crashlytics, Analytics, Remote Config, Performance, Messaging and flutter_local_notifications, plus full APNs configuration for iOS push. - Wire setupFirebase(env) and setupNotifications() in initApp - Add firebase_options for dev and staging via flutterfire (sf-platform-pre) - Register google-services / firebase-perf / crashlytics gradle plugins - Add per-flavor GoogleService-Info.plist with Build Phase script that copies the right plist into the .app bundle based on \$CONFIGURATION - Bump iOS deployment target 13.0 -> 15.0 (required by firebase_analytics) - Pin flutter_local_notifications to ^19.4.2 (v20+ needs Dart SDK >=3.10) - Add aps-environment to staging (development) and production entitlements; development flavor intentionally excluded (no App Store Connect entry) - Fix AppDelegate.swift to call super.application after forwarding to AntelopAppDelegate, otherwise Firebase Messaging swizzling breaks and the APNs token is never captured - Crashlytics reports in all builds (debug + release) for early detection - Tag analytics events with env user property per flavor - App Check intentionally not included (debug-token friction with large QA team); can be re-added release-only later
36 lines
1.2 KiB
Bash
Executable File
36 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Copies the correct GoogleService-Info.plist into the .app bundle
|
|
# based on the active build CONFIGURATION (Debug-development,
|
|
# Release-staging, etc.). Reads from ios/flavors/{flavor}/GoogleService-Info.plist
|
|
# and writes to the final bundle.
|
|
#
|
|
# Add this as a Run Script Build Phase in Xcode AFTER "Thin Binary" and
|
|
# BEFORE "[CP] Embed Pods Frameworks" (or near the end of the phases).
|
|
|
|
set -e
|
|
|
|
echo "Configuration: ${CONFIGURATION}"
|
|
|
|
# Extract flavor from the build configuration name (everything after the last "-")
|
|
if [[ $CONFIGURATION =~ \-([^-]*)$ ]]; then
|
|
flavor=${BASH_REMATCH[1]}
|
|
else
|
|
echo "warning: Could not extract flavor from CONFIGURATION='${CONFIGURATION}', defaulting to 'development'"
|
|
flavor="development"
|
|
fi
|
|
|
|
echo "Flavor: $flavor"
|
|
|
|
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
|
|
GOOGLESERVICE_INFO_FILE="${PROJECT_DIR}/flavors/${flavor}/${GOOGLESERVICE_INFO_PLIST}"
|
|
|
|
if [ ! -f "$GOOGLESERVICE_INFO_FILE" ]; then
|
|
echo "error: ${GOOGLESERVICE_INFO_FILE} not found"
|
|
exit 1
|
|
fi
|
|
|
|
PLIST_DESTINATION="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app"
|
|
echo "Copying ${GOOGLESERVICE_INFO_FILE} -> ${PLIST_DESTINATION}/${GOOGLESERVICE_INFO_PLIST}"
|
|
cp "${GOOGLESERVICE_INFO_FILE}" "${PLIST_DESTINATION}/${GOOGLESERVICE_INFO_PLIST}"
|