Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn iOS

UIScene lifecycle: yêu cầu khởi động iOS 27 mà app Flutter phải đạt

Lifecycle theo scene của Apple không còn tùy chọn với app build bằng SDK mới nhất. iOS 27 / Xcode 27 sẽ không launch app UIKit chưa dùng UIScene . Flutter 3.47 đổi gì Nâng minimum: iOS 15 , macOS 12 (từ 13 / 10.15). CLI migrate AppDelegate thường tự động. Việc tay còn lại nếu bạn customize lifecycle hook hoặc plugin còn giả định model cũ. Checklist migrate Update Xcode và Flutter về cặp được hỗ trợ. Clean build và đọc output migrate của CLI. Rà plugin có API chỉ UIApplicationDelegate. Test cold start, background→foreground, dialog quyền. Cạm bẫy “Chạy được trên simulator” là chưa đủ — test device với SDK mới. Deep link và notification handler thường nằm trong lifecycle code; test lại. Bài viết gốc đăng tại FlutterCook . Bản trên đó là bản được cập nhật mới nhất.

UIScene lifecycle: the iOS 27 launch requirement Flutter apps must meet

Apple’s scene-based lifecycle is no longer optional for apps built with the latest SDKs. iOS 27 / Xcode 27 will fail launches for UIKit apps that do not adopt UIScene . What Flutter 3.47 changes Minimums rise: iOS 15 , macOS 12 (from 13 / 10.15). The CLI migrates typical AppDelegate setups automatically. Manual work remains if you customized lifecycle hooks or use plugins that still assume the old model. Migration checklist Update Xcode and Flutter to the supported pair. Clean build and look for CLI migration output. Audit plugins for UIApplicationDelegate-only APIs. Test cold start, background→foreground, and permission dialogs. Pitfalls “It launches in the simulator” is not enough — test a device with the new SDK. Deep links and notification handlers often live in lifecycle code; retest them. Originally published on FlutterCook . Read the latest version there — that copy is the one kept up to date.

UIScene lifecycle: the iOS 27 launch gate for Flutter apps — hướng dẫn Flutter

Apple’s scene-based lifecycle is mandatory for apps built with the latest SDKs. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi Xcode 27 fails launches without UIScene. What Flutter migrates automatically. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Flutter CLI migrates typical AppDelegate setups; custom hooks need a manual pass. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate intent rồi ...

UIScene lifecycle: the iOS 27 launch gate for Flutter apps

Apple’s scene-based lifecycle is mandatory for apps built with the latest SDKs. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence Xcode 27 fails launches without UIScene. What Flutter migrates automatically. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Flutter CLI migrates typical AppDelegate setups; custom hooks need a manual pass. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, ...

TestFlight internal vs external testing that finds real bugs — hướng dẫn Flutter

External testers find environment bugs internal teams never see. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi Groups, feedback, and build expiry planning. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Keep a always-green internal build for demos. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate intent rồi gọi boundary. Boundary trả về data có kiểu hoặc failure có kiểu, không trả string c...

TestFlight internal vs external testing that finds real bugs

External testers find environment bugs internal teams never see. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence Groups, feedback, and build expiry planning. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Keep a always-green internal build for demos. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, refresh, or retry. A controller or use case validates the intent and calls the boun...

Swift Package Manager plugin migration checklist for Flutter — hướng dẫn Flutter

CocoaPods is maintenance mode. Flutter 3.44+ resolves iOS/macOS deps with SwiftPM by default. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi What iOS/macOS plugin authors must ship after SwiftPM became the default. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate inten...

Swift Package Manager là mặc định iOS/macOS — rời CocoaPods

CocoaPods đang ở chế độ maintenance. Flutter 3.44 đặt Swift Package Manager làm mặc định cho dependency iOS và macOS. CLI migrate Xcode project ở lần flutter run / flutter build kế tiếp. App developer thấy gì Happy path không cần cài Ruby/CocoaPods. Add-to-App có flutter build swift-package để đóng gói module thành Swift Package. Plugin còn bắt buộc CocoaPods sẽ bị CLI cảnh báo và fallback tạm. Plugin author cần ship gì Thêm Package.swift . Depend FlutterFramework nếu đã migrate pilot 2024. Nâng constraint Flutter tối thiểu lên 3.44 khi chuyển. Plugin chưa migrate bị trừ điểm pub.dev và sẽ không resolve được nữa. Opt-out tạm # pubspec.yaml flutter : enable-swift-package-manager : false Hoặc --no-enable-swift-package-manager trên CLI. Opt-out sẽ bị gỡ; mở issue kèm Xcode project nếu SwiftPM làm hỏng tích hợp thật. Checklist trước khi xóa Podfile flutter clean rồi build iOS đầy đủ CI không còn cài CocoaPods cho app này Mọi plugin trong tree resolve bằ...

Swift Package Manager plugin migration checklist for Flutter

CocoaPods is maintenance mode. Flutter 3.44+ resolves iOS/macOS deps with SwiftPM by default. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence What iOS/macOS plugin authors must ship after SwiftPM became the default. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, su...

Swift Package Manager is the iOS/macOS default — leave CocoaPods behind

CocoaPods is in maintenance mode. Flutter 3.44 makes Swift Package Manager the default for iOS and macOS dependency resolution. The CLI migrates the Xcode project on the next flutter run / flutter build . What app developers see No Ruby/CocoaPods install required for the happy path. Add-to-App gains flutter build swift-package to emit a Swift Package for native hosts. Plugins that still require CocoaPods trigger a CLI warning and temporary fallback. What plugin authors must ship If you maintain an iOS/macOS plugin: Add a Package.swift . Depend on FlutterFramework if you migrated in the 2024 pilot. Raise the minimum Flutter constraint to 3.44 when you switch. Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Temporary opt-out # pubspec.yaml flutter : # temporary escape hatch — file a bug if you need it enable-swift-package-manager : false Or pass --no-enable-swift-package-manager on the command line. Opt-outs will be removed; op...

Privacy manifests and required reason APIs for Flutter plugins — hướng dẫn Flutter

Apple requires declared reasons for certain APIs. Plugins must ship manifests. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi What App Store privacy nutrition labels mean for plugin authors. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Audit transitive plugins before submission, not after rejection. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate intent rồi gọi boundary. Boundary trả về ...

Privacy manifests and required reason APIs for Flutter plugins

Apple requires declared reasons for certain APIs. Plugins must ship manifests. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence What App Store privacy nutrition labels mean for plugin authors. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Audit transitive plugins before submission, not after rejection. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, refresh, or retry. A controlle...

Privacy manifests and required reason APIs for Flutter plugins — hướng dẫn Flutter

Apple requires declared reasons for certain APIs. Plugins must ship manifests. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi What App Store privacy nutrition labels mean for plugin authors. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Audit transitive plugins before submission, not after rejection. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate intent rồi gọi boundary. Boundary trả về ...

UIScene lifecycle: the iOS 27 launch gate for Flutter apps

Apple’s scene-based lifecycle is mandatory for apps built with the latest SDKs. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence Xcode 27 fails launches without UIScene. What Flutter migrates automatically. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Flutter CLI migrates typical AppDelegate setups; custom hooks need a manual pass. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, ...

TestFlight internal vs external testing that finds real bugs

External testers find environment bugs internal teams never see. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence Groups, feedback, and build expiry planning. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Keep a always-green internal build for demos. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, refresh, or retry. A controller or use case validates the intent and calls the boun...

Swift Package Manager plugin migration checklist for Flutter

CocoaPods is maintenance mode. Flutter 3.44+ resolves iOS/macOS deps with SwiftPM by default. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence What iOS/macOS plugin authors must ship after SwiftPM became the default. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Unmigrated plugins score lower on pub.dev and will eventually stop resolving. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, su...

The April 2027 SDK deadline for App Store uploads — hướng dẫn Flutter

Stores will reject older SDK builds. Upgrade before the crunch. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi Why you should upgrade Xcode and Flutter toolchains now. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế Test UIScene, privacy manifests, and SwiftPM early. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate intent rồi gọi boundary. Boundary trả về data có kiểu hoặc failure có kiểu, k...

The April 2027 SDK deadline for App Store uploads

Stores will reject older SDK builds. Upgrade before the crunch. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence Why you should upgrade Xcode and Flutter toolchains now. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Test UIScene, privacy manifests, and SwiftPM early. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, refresh, or retry. A controller or use case validates the intent a...

Flavor trong Flutter: một codebase, ba ứng dụng, không copy-paste cấu hình

Phiên bản tệ của việc xử lý môi trường trông như thế này: const bool isProd = false ; final apiBase = isProd ? 'https://api.example.com' : 'https://staging.api.example.com' ; Nó chạy được cho tới khi ai đó phát hành với cờ bật sai chiều, hoặc tới khi QA cần cài song song staging và production rồi phát hiện cả hai có cùng bundle id. Flavor giải quyết cả hai vấn đề ở tầng build: ba ứng dụng cài được riêng biệt, mỗi cái được biên dịch kèm cấu hình của chính nó. Phía Dart trước đã Bắt đầu từ đây vì đây là phần quyết định mọi thứ còn lại. // lib/config/app_config.dart enum Flavor { dev, staging, prod } final class AppConfig { const AppConfig ._({ required this .flavor, required this .apiBase, required this .appName, }); final Flavor flavor; final String apiBase; final String appName; static const _flavorName = String . fromEnvironment ( 'FLAVOR' , defaultValue : 'dev' , ...

Privacy manifests and required reason APIs for Flutter plugins

Apple requires declared reasons for certain APIs. Plugins must ship manifests. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence What App Store privacy nutrition labels mean for plugin authors. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model Audit transitive plugins before submission, not after rejection. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, refresh, or retry. A controlle...