Files
be_happy_public/ios/README.md
din4_4 713cc2520b fix(ios): запуск на iOS — MapKit, ключ из xcconfig, CocoaPods
- AppDelegate: YMKMapKit до super, регистрация плагинов по шаблону Flutter 3.41
- Info.plist: YandexMapKitApiKey из $(YANDEX_MAPKIT_API_KEY)
- Debug/Release/Profile.xcconfig: ключ, include Pods и опциональный Secrets
- Podfile, workspace, pbxproj; .gitignore для Secrets.xcconfig, пример Secrets
- ios/README.md

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 10:32:18 +03:00

55 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# iOS
Flutter + CocoaPods. Нативка через плагины — зависимости смотри в `Podfile` / `Podfile.lock`.
## Окружение
Полный Xcode (не только CLT). После апдейта Xcode:
```bash
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
```
Нет нужного iOS в сборке — Xcode → Settings → Platforms, докачать runtime. `flutter doctor -v` для быстрой проверки toolchain.
## Сборка из репозитория
Из корня (важно для `Generated.xcconfig`):
```bash
flutter pub get
cd ios && pod install && cd ..
```
Открывать **`Runner.xcworkspace`**, не `Runner.xcodeproj`.
Ключ **Yandex MapKit**: в `Info.plist``YandexMapKitApiKey` = `$(YANDEX_MAPKIT_API_KEY)`. Значение задаётся в `ios/Flutter/Debug.xcconfig`, `Release.xcconfig`, `Profile.xcconfig` (в конце файла; опционально перед этим `#include? "Secrets.xcconfig"` — см. `Secrets.xcconfig.example`). В `AppDelegate.swift` до `super.application` вызываются `YMKMapKit.setLocale` / `setApiKey` из plist — иначе SDK падает при регистрации плагина.
## Подпись
Runner → Signing & Capabilities, свой Team. Bundle id: `com.sparkit.beHappy` — должен совпадать с App ID в developer portal под TestFlight / App Store.
## Артефакты
```bash
flutter build ipa
```
`.ipa` — в `build/ios/ipa/` (точный путь Flutter печатает в конце).
Альтернатива: Xcode → Archive → Distribute. `ExportOptions.plist` в репу не коммитим.
## Симулятор
```bash
flutter devices
flutter run -d <device_id>
```
У `mobile_scanner` 5.x в Pods тянется Google ML Kit; на симуляторах Apple Silicon под свежим iOS Xcode часто ругается на arm64 и криво матчит destination. Если `flutter run` на симе отвалился — собери на **физическом устройстве** или проверь обновления плагина / обходы в `Podfile` под твою связку Xcode + runtime.
## Ссылки
[Flutter: iOS deployment](https://docs.flutter.dev/deployment/ios)