feat!: 6.0.0 Major Refactoring - Complete Breaking Changes - #510
Conversation
|
This version 6.0.0 purchaseUpdatedListener for iOS doesn't work. When requestPurchase on iOS the result doesn't call purchaseUpdatedListener. |
|
Another error for finishTransaction on Android calling 'consumeProduct' and 'acknowledgePurchase' passing token key should be 'purchaseToken' instead of 'token'. |
BREAKING CHANGE: Complete refactoring for v6.0.0 - Move all enums from types.dart to enums.dart - Fix all type inference and strict type warnings - Remove deprecated methods - Improve type safety throughout the codebase - Reorganize file structure for better maintainability
- Update FlutterInappPurchase.channel to FlutterInappPurchase.instance.channel - Fix all channel.setMethodCallHandler references in tests - Resolve static_access_to_instance_member errors
- Update all ErrorCode enum values from SCREAMING_SNAKE_CASE to lowerCamelCase - Update all references throughout the codebase - Fix constant_identifier_names lint warnings - Update error mapping utilities and tests
- Replace double quotes with single quotes where appropriate - Remove unnecessary 'this.' qualifiers - Fix parameter ordering (required parameters before optional) - Improve code consistency
- Change PeriodUnitIOS enum values to lowerCamelCase - Add library directive to error_mapping.dart - Fix dangling library doc comment warning
- Format lib/flutter_inapp_purchase.dart - Format lib/modules/android.dart - Format lib/modules/ios.dart - Format lib/types.dart - Ensure consistent code formatting
- Update all example screens to use the new API - Remove duplicate use_iap.dart from example (now using lib version) - Fix imports and update code to match new structure - Clean up example app implementation
- Add migration guide for ErrorCode enum changes - Add migration guide for PeriodUnitIOS enum changes - Add error handling examples with new enum values - Update CHANGELOG.md with breaking changes - Add mixin architecture notes
- Move channel initialization to setUpAll to ensure it runs within test zone - Fix 'There is no current invoker' error in tests - All tests now pass successfully
- Update community section with Stack Overflow, GitHub Issues, and Slack - Change API Reference link to /docs/api/ - Remove Basic Setup link from footer - Update copyright to 'Copyright © 2025 hyochan.' - Remove Common Migration Issues section from migration guide - Fix sidebar configuration for examples/subscription-store
Promotional Offers are iOS-only feature, not available on Android. Updated table to reflect accurate platform capabilities.
Add detailed API documentation structure: - Core methods and functions - Error codes and handling - Event listeners and streams - Type definitions and interfaces - useIAP hook documentation - Examples category configuration These provide complete reference documentation for developers.
- Enhance basic store example with comprehensive implementation - Update FAQ with common questions and solutions - Improve lifecycle guide with detailed state management - Add offer code redemption guide for iOS promotional offers - Update purchases guide with best practices - Enhance troubleshooting guide with common issues These updates provide better developer guidance and examples.
- Update homepage content and styling for flutter_inapp_purchase - Add version configuration for proper versioning support - Improve landing page user experience These changes enhance the documentation site's presentation.
Add comprehensive debug screen for testing purchase functionality: - View available products and pricing - Test purchase flows and error handling - Debug purchase states and transactions - Monitor connection status This helps developers test and debug in-app purchase implementations.
Update iOS deployment target to 15.0 to support StoreKit 2 features and ensure compatibility with latest iOS capabilities for in-app purchases.
Update homepage navigation links to match current documentation structure: - Guides: /guides/basic-setup → /guides/purchases - API Reference: /api/flutter-inapp-purchase → /api/ - Examples: /examples/basic-purchase → /examples/basic-store These links now correctly point to existing documentation pages.
Add npm start command to allowed bash commands for easier documentation development workflow.
Remove outdated "dooboolab" comment from gitignore.
Update all navigation links in homepage cards to include proper /docs prefix: - Getting Started: /getting-started/installation → /docs/getting-started/installation - Guides: /guides/purchases → /docs/guides/purchases - API Reference: /api/ → /docs/api/ - Examples: /examples/basic-store → /docs/examples/basic-store - Bottom CTA: /getting-started/installation → /docs/getting-started/installation These links now correctly navigate to the documentation pages.
- Moved Android source files to new package structure - Updated package declarations in all Kotlin files - Updated import statements across the codebase - Modified Android manifest and build.gradle - Updated pubspec.yaml plugin configuration - Updated all documentation references - Changed package namespace throughout the project This aligns the package naming with the current maintainer domain.
Fix dart format issues detected in CI: - Format debug_purchases_screen.dart - Format home_screen.dart - Apply consistent code formatting across all Dart files This resolves the CI formatting check failures.
- Streamline README to essential information only - Add prominent link to documentation site (flutter-inapp-purchase.hyo.dev) - Include quick start example and key features - Redirect detailed documentation to the dedicated site - Keep only essential setup and community information - Update ProGuard rules to use new package name (dev.hyochan) This makes the README more focused while providing comprehensive documentation through the dedicated site.
- Move Android source files to new package structure (dev.hyo.flutterinapppurchase) - Update package declarations in all Kotlin files - Update Android manifest and build.gradle configurations - Update pubspec.yaml plugin configuration - Update all documentation references - Update ProGuard rules for new package name This shortens the package name for better consistency with domain.
- Rename docs/ to doc/ to follow pub.dev layout convention - Add CHANGELOG.md entry for v6.0.0-rc.1 release candidate - Document breaking changes and migration guide - Include package name changes and new features This resolves pub validation warnings for publication.
Exclude doc/, example/, test/, and development files from pub.dev package to reduce package size and focus on core plugin functionality.
- Fix iOS purchaseUpdatedListener not triggering on direct purchases - Fix Android finishTransaction to use 'purchaseToken' instead of 'token' parameter
- Use deepLinkToSubscriptionsAndroid() instead of throwing NOT_IMPLEMENTED error - Allows Android users to manage subscriptions through Play Store
da29bc1 to
672e874
Compare
|
@FelixYew Thanks for testing |
## Summary - Add Swift Package Manager (SPM) support alongside existing CocoaPods support - Create Package.swift configuration for SPM - Maintain backward compatibility with CocoaPods ## Changes - Added `Package.swift` file with proper SPM configuration - Updated `pubspec.yaml` to include `sharedDarwinSource: true` for iOS platform - Created `darwin/` directory structure for shared iOS/macOS code - Modified podspec to avoid file duplication issues ## Context As mentioned in the issue #506, Flutter is moving towards Swift Package Manager support since CocoaPods is transitioning to read-only mode. This PR adds SPM support while maintaining full backward compatibility with existing CocoaPods users. ## Test plan - [x] Tested with CocoaPods - pod install works correctly - [x] Verified no duplicate file errors during build - [ ] Test with Swift Package Manager enabled projects - [ ] Verify example app builds and runs correctly Closes #506
|
@hyochan Thanks for the fixes. Is working now. |
|
Hi @hyochan, i have just updated to version [6.0.0-rc.3] and i take this eror when run |
|
@doublev2906 Could you kindly share your Xcode version and also check the doc in expo-iap? It isn't in flutter doc but this is same issue as in https://expo-iap.hyo.dev/docs/guides/faq#build-error-apptransactionid-property-not-found. |
|
@hyochan I am used xcode version 16.2. Sorry about a mistake. Thank you so much. |
🚀 Summary
Major refactoring for flutter_inapp_purchase v6.0.0 with complete breaking changes to improve type safety, code organization, and developer experience.
💥 BREAKING CHANGES
File Structure
types.dartto newenums.dartfileStore.darttoenums.dartfor consistencymodules/android.dartfor Android-specific functionalitymodules/ios.dartfor iOS-specific functionalitytypes/iap_android_types.darttypes/iap_ios_types.dartType Safety Improvements
List<dynamic>?warnings with explicit type annotationsFuture<dynamic>return types where applicableRemoved Deprecated APIs
_finishTransactionIOSOldmethodError Handling
utils/error_mapping.dartfor centralized error handling✨ New Features
use_iap.darthook for Flutter Hooks integration📝 Migration Guide
Import Changes
Enum Usage
All enums are now imported from
enums.dart. Thetypes.dartfile exportsenums.dartfor backward compatibility, but direct imports are recommended.Platform-Specific Code
🧪 Test Plan
📊 Impact
This is a major version bump (v6.0.0) with extensive breaking changes. All users will need to update their code when upgrading.
Closes #505 #507 #503 #501 #500 #496 #495 #494 #491 #482