Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit 0b3abf3

Browse files
committed
Initial copy of react-native-iap v14
0 parents  commit 0b3abf3

34 files changed

+4504
-0
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Select Xcode
17+
run: |
18+
echo "Available Xcode versions:"
19+
ls -la /Applications | grep Xcode
20+
# Use the latest available Xcode
21+
sudo xcode-select -s /Applications/Xcode.app
22+
23+
- name: Build
24+
run: swift build
25+
26+
- name: Run tests
27+
run: swift test

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Claude AI
2+
.claude/
3+
4+
# Swift Package Manager
5+
.build/
6+
.swiftpm/
7+
Package.resolved
8+
9+
# Xcode
10+
*.xcodeproj/xcuserdata/
11+
*.xcworkspace/xcuserdata/
12+
*.xcuserstate
13+
DerivedData/
14+
build/
15+
16+
# CocoaPods
17+
Pods/
18+
*.xcworkspace
19+
!default.xcworkspace
20+
21+
# macOS
22+
.DS_Store
23+
.DS_Store?
24+
._*
25+
.Spotlight-V100
26+
.Trashes
27+
ehthumbs.db
28+
Thumbs.db
29+
30+
# iOS
31+
*.ipa
32+
*.dSYM.zip
33+
*.dSYM
34+
35+
# Temporary files
36+
*.tmp
37+
*.temp
38+
*~.nib
39+
*.swp
40+
*.log

.vscode/launch.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node-terminal",
6+
"request": "launch",
7+
"name": "🍎 Open Example in Xcode",
8+
"command": "open Martie.xcodeproj",
9+
"cwd": "${workspaceFolder}/Example",
10+
"group": "build"
11+
},
12+
{
13+
"type": "node-terminal",
14+
"request": "launch",
15+
"name": "📱 Build & Run Example (iOS Simulator)",
16+
"command": "xcodebuild -project Martie.xcodeproj -scheme IosIapExample -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.5' build",
17+
"cwd": "${workspaceFolder}/Example",
18+
"group": "build"
19+
},
20+
{
21+
"type": "node-terminal",
22+
"request": "launch",
23+
"name": "📦 Swift Package Build",
24+
"command": "swift build",
25+
"cwd": "${workspaceFolder}",
26+
"group": "build"
27+
},
28+
{
29+
"type": "node-terminal",
30+
"request": "launch",
31+
"name": "🧪 Swift Package Test",
32+
"command": "swift test",
33+
"cwd": "${workspaceFolder}",
34+
"group": "test"
35+
},
36+
{
37+
"type": "node-terminal",
38+
"request": "launch",
39+
"name": "☕ CocoaPods Build",
40+
"command": "pod install",
41+
"cwd": "${workspaceFolder}",
42+
"group": "build"
43+
},
44+
{
45+
"type": "node-terminal",
46+
"request": "launch",
47+
"name": "🔍 CocoaPods Lint",
48+
"command": "pod lib lint --allow-warnings",
49+
"cwd": "${workspaceFolder}",
50+
"group": "build"
51+
}
52+
]
53+
}

CLAUDE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Claude Development Guidelines for ios-iap
2+
3+
## Swift Naming Conventions for Acronyms
4+
5+
### General Rule
6+
7+
- **Acronyms should be ALL CAPS only when they appear as a suffix**
8+
- **When acronyms appear at the beginning or middle, use Pascal case (first letter caps, rest lowercase)**
9+
- **Package/Module names follow the same rule: `IosIAP` (iOS at beginning = `Ios`, IAP as suffix = `IAP`)**
10+
11+
### Examples
12+
13+
#### ✅ Correct
14+
15+
- `IosIAP` (Package name: iOS at beginning, IAP as suffix)
16+
- `IapManager` (IAP at beginning)
17+
- `IapPurchase` (IAP at beginning)
18+
- `IapError` (IAP at beginning)
19+
- `IosIapTests` (both iOS and IAP at beginning/middle)
20+
- `ProductIAP` (IAP as suffix)
21+
- `ManagerIAP` (IAP as suffix)
22+
23+
#### ❌ Incorrect
24+
25+
- `IosIap` (should be `IosIAP` - IAP is suffix)
26+
- `IAPManager` (should be `IapManager`)
27+
- `IAPPurchase` (should be `IapPurchase`)
28+
- `IAPError` (should be `IapError`)
29+
- `IosIAPTests` (should be `IosIapTests` - IAP is in middle, not suffix)
30+
31+
### Specific Cases
32+
33+
- **iOS**: `Ios` when at beginning/middle, `IOS` when as suffix
34+
- **IAP**: `Iap` when at beginning/middle, `IAP` when as suffix
35+
- **API**: `Api` when at beginning/middle, `API` when as suffix
36+
- **URL**: `Url` when at beginning/middle, `URL` when as suffix
37+
38+
## Testing
39+
40+
- Run tests with: `swift test`
41+
- Build with: `swift build`
42+
- Use real product IDs: `dev.hyo.martie.10bulbs`, `dev.hyo.martie.30bulbs`
43+
44+
## Development Notes
45+
46+
- Purchase Flow should display real-time purchase events
47+
- Transaction observer handles purchase completion
48+
- Mock data available for testing when real products not configured

Example/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
}
8+
],
9+
"info" : {
10+
"author" : "xcode",
11+
"version" : 1
12+
}
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import SwiftUI
2+
3+
struct ContentView: View {
4+
var body: some View {
5+
NavigationView {
6+
HomeScreen()
7+
}
8+
}
9+
}
10+
11+
#Preview {
12+
ContentView()
13+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import SwiftUI
2+
import IosIAP
3+
4+
@main
5+
@available(iOS 15.0, *)
6+
struct IosIapExampleApp: App {
7+
var body: some Scene {
8+
WindowGroup {
9+
ContentView()
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)