Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 11 additions & 25 deletions .github/workflows/ci-gemini-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
issue_comment:
types: [created]

# Ensure only one run per-issue at a time and avoid duplicates
concurrency:
group: ci-gemini-pr-${{ github.event.issue.number }}
cancel-in-progress: true
Expand All @@ -16,6 +15,7 @@ permissions:
contents: write
issues: write
pull-requests: write
id-token: write

jobs:
analyze-and-pr:
Expand Down Expand Up @@ -46,7 +46,12 @@ jobs:
id: analyze-pr
uses: google-github-actions/run-gemini-cli@v0
timeout-minutes: 20
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Code Assist settings
use_gemini_code_assist: true
gemini_model: "gemini-2.5-pro"
prompt: |
You are an expert Flutter developer helping with the flutter_inapp_purchase package.

Expand Down Expand Up @@ -91,36 +96,17 @@ jobs:
settings: |
{
"tools": [
{
"name": "gh",
"description": "GitHub CLI for creating branches and PRs"
},
{
"name": "git",
"description": "Git commands for version control"
},
{
"name": "flutter",
"description": "Flutter CLI for testing and analysis"
},
{
"name": "dart",
"description": "Dart CLI for formatting and analysis"
}
{ "name": "gh", "description": "GitHub CLI for creating branches and PRs" },
{ "name": "git", "description": "Git commands for version control" },
{ "name": "flutter", "description": "Flutter CLI for testing and analysis" },
{ "name": "dart", "description": "Dart CLI for formatting and analysis" }
],
"repositories": [
{
"path": ".",
"instructions": "Refer to CLAUDE.md for conventions. Keep changes minimal, add tests, and follow pre-commit checks."
}
{ "path": ".", "instructions": "Refer to CLAUDE.md for conventions. Keep changes minimal, add tests, and follow pre-commit checks." }
],
"model": "gemini-1.5-flash"
}

gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on issue with result
if: always()
uses: actions/github-script@v7
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ jobs:

- run: flutter pub get

- run: dart format --page-width 80 --trailing-commas automate --output=none --set-exit-if-changed .
- name: Check formatting (excluding generated files)
shell: bash
run: |
set -euo pipefail
files=$(git ls-files '*.dart' | grep -Ev '^lib/types\.dart$|\.g\.dart$|\.freezed\.dart$' || true)
if [[ -z "$files" ]]; then
exit 0
fi
printf '%s\n' "$files" | xargs dart format --page-width 80 --output=none --set-exit-if-changed

# - run: flutter analyze .

Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

// Dart & Flutter settings
"dart.flutterSdkPath": null,
"dart.doNotFormat": [
"lib/types.dart"
],
"[dart]": {
"editor.rulers": [80],
"editor.selectionHighlight": false,
Expand Down Expand Up @@ -62,5 +65,5 @@
// Docusaurus specific
"typescript.tsdk": "docs/node_modules/typescript/lib",
"npm.packageManager": "npm",
"cSpell.words": ["inapp", "Inapp"]
"cSpell.words": ["inapp", "Inapp", "skus"]
}
1 change: 1 addition & 0 deletions AGENTS.md
18 changes: 15 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ final allPurchases = await iap.getAvailablePurchases(

## Flutter-Specific Guidelines

### Generated Files

- `lib/types.dart` is generated from the OpenIAP schema. Never edit it by hand.
- Always regenerate via `./scripts/generate-type.sh` so the file stays in sync with the upstream `openiap-dart` package.
- If the generation script fails, fix the script or the upstream source instead of patching the output manually.

### Documentation Style

- **Avoid using emojis** in documentation, especially in headings
Expand All @@ -53,9 +59,9 @@ final allPurchases = await iap.getAvailablePurchases(

Before committing any changes, run these commands in order and ensure ALL pass:

1. **Format check**: `dart format --set-exit-if-changed .`
- This will fail if any files need formatting (exit code 1)
- If it fails, run `dart format .` to fix formatting, then retry
1. **Format check**: `git ls-files '*.dart' | grep -v '^lib/types.dart$' | xargs dart format --page-width 80 --output=none --set-exit-if-changed`
- This matches the CI formatter and skips the generated `lib/types.dart`
- If it fails, run the same command without `--set-exit-if-changed` (or drop the `--output` flag) to auto-format, then retry
- Always format code before committing to maintain consistent style
2. **Lint check**: `flutter analyze`
- Fix any lint issues before committing
Expand All @@ -65,6 +71,12 @@ Before committing any changes, run these commands in order and ensure ALL pass:
4. **Final verification**: Re-run `dart format --set-exit-if-changed .` to confirm no formatting issues
5. Only commit if ALL checks succeed with exit code 0

### Commit Message Convention

- Follow the Angular commit style: `<type>: <short summary>` (50 characters max).
- Use lowercase `type` (e.g., `feat`, `fix`, `docs`, `chore`, `test`).
- Keep the summary concise and descriptive; avoid punctuation at the end.

**Important**:
- Use `--set-exit-if-changed` flag to match CI behavior and catch formatting issues locally before they cause CI failures
- When using generic functions like `showModalBottomSheet`, always specify explicit type arguments (e.g., `showModalBottomSheet<void>`) to avoid type inference errors
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ flutter run
By default, this plugin depends on the published artifact:

```
implementation "io.github.hyochan.openiap:openiap-google:1.1.0"
implementation "io.github.hyochan.openiap:openiap-google:1.1.11"
```

If you need to debug against a local checkout of the OpenIAP Android module:
Expand All @@ -127,17 +127,17 @@ If you need to debug against a local checkout of the OpenIAP Android module:
Edit `android/build.gradle` dependencies to use the local project in debug only:

```
// implementation "io.github.hyochan.openiap:openiap-google:1.1.0"
// implementation "io.github.hyochan.openiap:openiap-google:1.1.11"
debugImplementation project(":openiap")
releaseImplementation "io.github.hyochan.openiap:openiap-google:1.1.0"
releaseImplementation "io.github.hyochan.openiap:openiap-google:1.1.11"
```

4. 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` and restore the single
`implementation "io.github.hyochan.openiap:openiap-google:1.1.0"` line in `android/build.gradle`.
`implementation "io.github.hyochan.openiap:openiap-google:1.1.11"` line in `android/build.gradle`.

### 5. Commit Your Changes

Expand Down
106 changes: 0 additions & 106 deletions GEMINI.md

This file was deleted.

5 changes: 4 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ linter:
- use_rethrow_when_possible

analyzer:
exclude:
- lib/types.dart
- example/**
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
strict-raw-types: true
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {

dependencies {
// OpenIAP Google billing wrapper (1.1.0) includes Google Play Billing
implementation "io.github.hyochan.openiap:openiap-google:1.1.0"
implementation "io.github.hyochan.openiap:openiap-google:1.1.11"

// For local debugging with a checked-out module, you can switch to:
// debugImplementation project(":openiap")
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.license = { :type => 'BSD' }
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '13.0'
s.ios.deployment_target = '12.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
# Ensure openiap resolves to 1.1.9 even if trunk index is lagging
pod 'openiap', :git => 'https://github.com/hyodotdev/openiap-apple.git', :tag => '1.1.9'
pod 'openiap', :git => 'https://github.com/hyodotdev/openiap-apple.git', :tag => '1.1.12'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Expand Down
20 changes: 10 additions & 10 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ PODS:
- Flutter (1.0.0)
- flutter_inapp_purchase (0.0.1):
- Flutter
- openiap (= 1.1.9)
- openiap (1.1.9)
- openiap (= 1.1.12)
- openiap (1.1.12)

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_inapp_purchase (from `.symlinks/plugins/flutter_inapp_purchase/ios`)
- openiap (from `https://github.com/hyodotdev/openiap-apple.git`, tag `1.1.9`)
- openiap (from `https://github.com/hyodotdev/openiap-apple.git`, tag `1.1.12`)

EXTERNAL SOURCES:
Flutter:
Expand All @@ -17,18 +17,18 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_inapp_purchase/ios"
openiap:
:git: https://github.com/hyodotdev/openiap-apple.git
:tag: 1.1.9
:tag: 1.1.12

CHECKOUT OPTIONS:
openiap:
:git: https://github.com/hyodotdev/openiap-apple.git
:tag: 1.1.9
:tag: 1.1.12

SPEC CHECKSUMS:
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_inapp_purchase: 919e64e275a3a68ed9a0b7798c3f51e591a1153f
openiap: dcfa2a4dcf31259ec4b73658e7d1441babccce66
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inapp_purchase: 8e8e96cc14bc141e3ffd432012fc9d4e347f8f71
openiap: e207e50cc83dc28cd00c3701421a12eacdbd163a

PODFILE CHECKSUM: 7f77729f2fac4d8b3c65d064abe240d5bd87fe01
PODFILE CHECKSUM: 9446ef2faab77e656d46b3aaf8938ab324919b93

COCOAPODS: 1.16.2
COCOAPODS: 1.15.2
10 changes: 9 additions & 1 deletion example/lib/src/screens/available_purchases_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ class _AvailablePurchasesScreenState extends State<AvailablePurchasesScreen> {
return uniquePurchases.values.toList();
}

IapPlatform _platformOrDefault() {
try {
return getCurrentPlatform();
} catch (_) {
return IapPlatform.Android;
}
}

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -121,7 +129,7 @@ class _AvailablePurchasesScreenState extends State<AvailablePurchasesScreen> {

// Load purchase history
List<Purchase> purchaseHistory = [];
if (getCurrentPlatform() == IapPlatform.ios) {
if (_platformOrDefault() == IapPlatform.IOS) {
// iOS: include expired subscriptions as history
purchaseHistory = await _iap.getAvailablePurchases(
const PurchaseOptions(onlyIncludeActiveItemsIOS: false),
Expand Down
Loading
Loading