Thank you for your interest in contributing! This guide will help you get started with development and submitting your contributions.
git clone https://github.com/hyodotdev/openiap.git
cd openiap/libraries/flutter_inapp_purchaseflutter pub get- This plugin uses the OpenIAP Apple native module via CocoaPods. See openiap-versions.json for the current version.
- After upgrading or cloning, run
pod installin your iOS project (e.g.,example/ios). - Minimum iOS deployment target is
15.0for StoreKit 2 support.
- This plugin uses the OpenIAP Google native module. See openiap-versions.json for the current version.
- The module is automatically fetched from Maven Central during build.
This repo ships with Git hooks under .githooks that auto-format, analyze, and test your changes before committing. Enable them once per clone:
git config core.hooksPath .githooksAfter this, committing will:
- Run
flutter pub get - Auto-format staged Dart files
- Verify repo-wide formatting (same as CI)
- Run
flutter analyze(non-blocking by default) - Run
flutter test
Hook options (env vars):
SKIP_PRECOMMIT_TESTS=1to skip testsPRECOMMIT_TEST_CONCURRENCY=<N>to control concurrency (default 4)PRECOMMIT_FAIL_FAST=0to disable--fail-fastPRECOMMIT_RUN_ALL_TESTS=0to only run changed testsENFORCE_ANALYZE=1to fail on analyzer warnings
Navigate to the example directory and run the app:
cd example
flutter pub get
# For iOS
flutter run --dart-define=IOS_PRODUCTS="your_product_ids"
# For Android
flutter run --dart-define=ANDROID_PRODUCTS="your_product_ids"Note: You'll need to configure your app with valid product IDs from your App Store Connect or Google Play Console.
-
Click the "Fork" button in the top-right corner
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/openiap.git cd openiap/libraries/flutter_inapp_purchase
git checkout -b feature/your-feature-name- Write your code following the project conventions
- Add tests for new functionality
- Update documentation as needed
# Format your code
dart format .
# Run tests
flutter test
# Run the example app to verify functionality
cd example
flutter runBy default, this plugin depends on the published artifact version from
openiap-versions.json:
implementation "io.github.hyochan.openiap:openiap-google:${openiapGoogleVersion}"
If you need to debug against the monorepo OpenIAP Android module:
-
Point Gradle to the local module.
Edit
android/settings.gradleand uncomment the lines, updating the path:include ':openiap' project(':openiap').projectDir = new File(settingsDir, '../../../packages/google/openiap') -
Sync and run.
Run a Gradle sync from Android Studio or rebuild the Flutter module.
To revert, comment out the include lines in
settings.gradle. Noandroid/build.gradledependency changes are needed.
git add .
git commit -m "feat: add your feature description"Follow conventional commit messages:
feat:for new featuresfix:for bug fixesdocs:for documentation changesrefactor:for code refactoringtest:for test additions/changeschore:for maintenance tasks
git push origin feature/your-feature-name- Go to your fork on GitHub
- Click "Pull request" button
- Select your branch and target
mainbranch of the original repository - Fill in the PR template with:
- Description of changes
- Related issue number (if applicable)
- Testing performed
- Submit the pull request
Please refer to CLAUDE.md for:
- Naming conventions
- Platform-specific guidelines
- API method naming
- OpenIAP specification compliance
- Code is formatted with
dart format . - All tests pass with
flutter test - Example app runs without errors
- Documentation is updated if needed
- Commit messages follow conventional format
- For new feature proposals, start a discussion at: https://github.com/hyodotdev/openiap/discussions
- For bugs, open an issue with a clear description and reproduction steps
- For questions, feel free to open a discussion
Thank you for contributing!