Fix connection lifecycle and undefined method issues#518
Merged
Conversation
- Replace direct method calls with proper channel invocations - Fix getAvailableItemsByType calls for Android platform - Use extractPurchased helper to process results correctly
- Change connection result comparison from string to boolean - Match the pattern used in purchase flow screen - Fixes 'Not connected' issue in subscription flow
- Add endConnection call to purchase_flow_screen dispose - Add endConnection call to subscription_flow_screen dispose - Add dispose method with endConnection to available_purchases_screen - Add endConnection call to offer_code_screen dispose - Properly close IAP connections when leaving screens
- Remove deprecated use_iap hook implementation - Add new errors and events modules - Update example app with new screen structure - Update documentation and types - Clean up deprecated methods and imports
- Format all Dart files with dart format - Fix line endings in multiple files - Ensure code style consistency
- Fix iOS error code mapping for eUserCancelled (should be 2, not 1) - Handle originalTransactionDateIOS field that can be int or String - Improve _extractDate method to handle test environment properly - Make date extraction more robust for both milliseconds and seconds
- Fix formatting issues detected by CI - Ensure consistent code style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes critical issues with IAP connection lifecycle management and undefined method errors in the Flutter InApp Purchase plugin.
Changes
Fix undefined method error in getAvailablePurchases
Fix connection check in subscription flow screen
Add proper connection lifecycle management
Remove hook and provider implementations
Update to version 6.0.0-rc.4
Breaking Changes
Test Plan
Related Issues
Fixes connection lifecycle issues reported in the example app where screens would show "Not connected" after navigating back and forth.