Skip to content

Commit f08682e

Browse files
support SPM
1 parent 5753d4d commit f08682e

72 files changed

Lines changed: 754 additions & 515 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,36 @@ on:
88
jobs:
99
build:
1010
runs-on: macos-latest
11+
# Swift Package Manager derives the local package identity from the checkout
12+
# directory name, so the repo must live in a folder named after the Dart
13+
# package (square_in_app_payments). Otherwise the example's SPM resolution
14+
# fails with a package identity mismatch against the plugin name.
15+
defaults:
16+
run:
17+
working-directory: square_in_app_payments
1118
steps:
1219
- uses: actions/checkout@v4
20+
with:
21+
path: square_in_app_payments
1322
- uses: actions/setup-java@v4
1423
with:
1524
distribution: 'temurin'
1625
java-version: '17'
1726
- uses: subosito/flutter-action@v2
1827
with:
1928
channel: 'stable'
20-
flutter-version: "3.32.2"
29+
flutter-version: "3.44.4"
2130
# or: 'beta', 'dev' or 'master'
31+
- run: flutter config --enable-swift-package-manager
2232
- run: flutter pub get
23-
#Android
33+
# Android
2434
- run: |
2535
cd example
2636
flutter pub get
2737
flutter build apk
28-
#IOS
38+
# iOS (Swift Package Manager — no CocoaPods)
2939
- run: |
3040
cd example
31-
flutter pub get
32-
cd ios
3341
flutter clean
34-
rm Pods && rm Podfile.lock
3542
flutter pub get
36-
pod install --repo-update
37-
xcodebuild -workspace Runner.xcworkspace -configuration Release -scheme Runner -sdk iphoneos SKIP_SETUP_SCRIPT=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
43+
flutter build ios --no-codesign

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
16
.DS_Store
27
.dart_tool/
8+
.atom/
9+
.build/
10+
.buildlog/
11+
.history
12+
.svn/
13+
.swiftpm/
14+
migrate_working_dir/
315

416
.packages
517
.pub/
618
pubspec.lock
19+
# IntelliJ related
20+
*.iml
21+
*.ipr
22+
*.iws
23+
.idea/
724

825
build/
926
android/.classpath
@@ -13,3 +30,16 @@ android/bin
1330
.vscode/settings.json
1431
.vscode/launch.json
1532
.clang-format
33+
# The .vscode folder contains launch configuration and tasks you configure in
34+
# VS Code which you may wish to be included in version control, so this line
35+
# is commented out by default.
36+
#.vscode/
37+
38+
# Flutter/Dart/Pub related
39+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
40+
/pubspec.lock
41+
**/doc/api/
42+
.dart_tool/
43+
.flutter-plugins-dependencies
44+
/build/
45+
/coverage/

.metadata

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "ad70ec4617166f1c38e5d2bfd388af71fda14f06"
8+
channel: "stable"
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06
17+
base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06
18+
- platform: android
19+
create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06
20+
base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06
21+
- platform: ios
22+
create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06
23+
base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06
24+
25+
# User provided section
26+
27+
# List of Local paths (relative to this file) that should be
28+
# ignored by the migrate tool.
29+
#
30+
# Files that are not part of the templates will be ignored by default.
31+
unmanaged_files:
32+
- 'lib/main.dart'
33+
- 'ios/Runner.xcodeproj/project.pbxproj'

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## Changelog
22

3+
### v2.0.0 Unreleased
4+
5+
* Added Swift Package Manager (SPM) as the primary iOS integration for Flutter 3.44. The Objective-C bridge now lives in the `square_in_app_payments_objc` SPM target with a thin Swift entry point (`SquareInAppPaymentsFlutterPlugin`); localized error strings are loaded via `SWIFTPM_MODULE_BUNDLE`.
6+
* CocoaPods remains supported for existing consumers. Because the plugin now ships a Swift entry point, CocoaPods apps must enable `use_frameworks!` in their `Podfile` (the default in modern Flutter projects); pure Objective-C apps that previously built without frameworks need to add it.
7+
* Migrated the Android build to the Gradle Kotlin DSL (`build.gradle.kts` / `settings.gradle.kts`) and replaced `jcenter()` with `mavenCentral()`.
8+
* Updated the example app to the Flutter UIScene lifecycle (`SceneDelegate`) and refreshed the example and plugin dependencies.
9+
310
### v1.7.14 Jul 23, 2026
411

512
* Updated to IAP SDK Android to 1.6.9 and iOS to 1.6.7 — see the [IAP SDK release notes](https://developer.squareup.com/docs/changelog/mobile-logs/2026-07-22)

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,25 @@ In addition to this README, the following is available in the [flutter plugin Gi
2727

2828
### Flutter
2929

30-
* Flutter version 3.0 or higher
31-
* Dart version 2.12 or higher
30+
* Flutter version 3.44 or higher (required for the Swift Package Manager iOS integration)
31+
* Dart version 3.12 or higher
3232

3333
### Android
3434

3535
* Android minSdkVersion is API 28 (Android 9).
3636
* Android Target SDK version: API 36 (Android 16).
3737
* Android SDK build tools: 26.0.3
38-
* Android Gradle Plugin: 3.0.0 or greater.
38+
* Android Gradle Plugin: 9.0 or greater (the plugin build uses the Gradle Kotlin DSL).
3939
* Support library: 27.1.1
4040
* Google Play Services: 16.0.1
4141
* Google APIs Intel x86 Atom_64 System Image
4242

4343
### iOS
4444

45-
* Xcode version: 10 or greater.
46-
* iOS Base SDK: 12 or greater.
47-
* Deployment target: iOS 12.0 or greater.
45+
* Xcode version: 16 or greater (required for Swift Package Manager).
46+
* iOS Base SDK: 14 or greater.
47+
* Deployment target: iOS 14.0 or greater.
48+
* iOS integration uses Swift Package Manager (SPM). CocoaPods is still supported; because the plugin ships a Swift entry point, CocoaPods apps must enable `use_frameworks!` in their `Podfile`.
4849
* This plugin will work on Mac with Intel processor and Apple silicon chips.
4950

5051
## In-App Payments SDK requirements and limitations

android/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
.DS_Store
77
/build
88
/captures
9-
.settings
9+
.settings
10+
.cxx

android/build.gradle

Lines changed: 0 additions & 56 deletions
This file was deleted.

android/build.gradle.kts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
group = "com.squareup.sqip.flutter"
2+
version = "1.4.0"
3+
4+
buildscript {
5+
repositories {
6+
google()
7+
mavenCentral()
8+
}
9+
10+
dependencies {
11+
classpath("com.android.tools.build:gradle:9.0.1")
12+
}
13+
}
14+
15+
rootProject.allprojects {
16+
repositories {
17+
google()
18+
mavenCentral()
19+
maven {
20+
url = uri("https://sdk.squareup.com/public/android")
21+
}
22+
}
23+
}
24+
25+
plugins {
26+
id("com.android.library")
27+
}
28+
29+
val minIapSdkVersion = "1.6.9"
30+
val compileSdkVersionDefault = 36
31+
32+
android {
33+
val sqipCompileSdkVersion = if (rootProject.hasProperty("sqipCompileSdkVersion")) {
34+
rootProject.property("sqipCompileSdkVersion").toString().toInt()
35+
} else {
36+
compileSdkVersionDefault
37+
}
38+
39+
compileSdk = sqipCompileSdkVersion
40+
41+
namespace = "sqip.flutter"
42+
43+
defaultConfig {
44+
minSdk = 28
45+
}
46+
47+
lint {
48+
disable.add("InvalidPackage")
49+
}
50+
51+
compileOptions {
52+
sourceCompatibility = JavaVersion.VERSION_17
53+
targetCompatibility = JavaVersion.VERSION_17
54+
}
55+
}
56+
57+
val sqipVersion = if (rootProject.hasProperty("sqipVersion")) {
58+
rootProject.property("sqipVersion").toString()
59+
} else {
60+
minIapSdkVersion
61+
}
62+
63+
dependencies {
64+
implementation("com.squareup.sdk.in-app-payments:card-entry:$sqipVersion")
65+
implementation("com.squareup.sdk.in-app-payments:google-pay:$sqipVersion")
66+
implementation("com.google.android.gms:play-services-wallet:19.1.0")
67+
implementation("com.squareup.sdk.in-app-payments:buyer-verification:$sqipVersion")
68+
}

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

android/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)