@modbender/capacitor-play-games 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -0
- package/CapacitorPlayGames.podspec +17 -0
- package/LICENSE +22 -0
- package/Package.swift +36 -0
- package/README.md +611 -0
- package/android/build.gradle +76 -0
- package/android/consumer-rules.pro +4 -0
- package/android/proguard-rules.pro +2 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/idleflowgames/playgames/AchievementsModule.kt +26 -0
- package/android/src/main/java/com/idleflowgames/playgames/LeaderboardsModule.kt +27 -0
- package/android/src/main/java/com/idleflowgames/playgames/Pgs.kt +48 -0
- package/android/src/main/java/com/idleflowgames/playgames/PlayGamesPlugin.kt +88 -0
- package/android/src/main/java/com/idleflowgames/playgames/SavedGamesModule.kt +119 -0
- package/android/src/main/java/com/idleflowgames/playgames/SignInModule.kt +83 -0
- package/dist/esm/definitions.d.ts +227 -0
- package/dist/esm/definitions.d.ts.map +1 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +33 -0
- package/dist/esm/web.d.ts.map +1 -0
- package/dist/esm/web.js +45 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +59 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +62 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/AchievementsModule.swift +73 -0
- package/ios/Plugin/LeaderboardsModule.swift +75 -0
- package/ios/Plugin/Pgs.swift +40 -0
- package/ios/Plugin/Plugin.swift +74 -0
- package/ios/Plugin/SavedGamesModule.swift +102 -0
- package/ios/Plugin/SignInModule.swift +139 -0
- package/package.json +80 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.3.0] - 2026-09-08
|
|
9
|
+
|
|
10
|
+
Forked from `@idleflowgames/capacitor-play-games` 0.2.1. Upstream's GitHub
|
|
11
|
+
repository 404s while its npm package remains published, so the source was
|
|
12
|
+
recovered from the published tarball; see "About this fork" in the README for
|
|
13
|
+
what that recovery involved.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Android: apply the Kotlin Android plugin. The build script declared
|
|
18
|
+
`kotlin-gradle-plugin` on the buildscript classpath and used a
|
|
19
|
+
`kotlin { compilerOptions { ... } }` block without ever applying the plugin,
|
|
20
|
+
so Gradle failed with `Could not find method kotlin()` before compiling any
|
|
21
|
+
source. Verified by reproduction: with the line reverted the build fails with
|
|
22
|
+
that exact error, and with it applied `assembleDebug` succeeds against a
|
|
23
|
+
Capacitor 8 app on Gradle 8.14.3 / AGP 8.13.0 / JDK 21.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Renamed to `@modbender/capacitor-play-games`, and the SwiftPM product from
|
|
28
|
+
`IdleflowgamesCapacitorPlayGames` to `ModbenderCapacitorPlayGames` to match —
|
|
29
|
+
Capacitor derives the product name from the full scoped package name.
|
|
30
|
+
- Toolchain: pnpm to bun; dropped the Biome and SwiftLint dev dependencies
|
|
31
|
+
rather than ship lint configuration that has never been run here.
|
|
32
|
+
|
|
33
|
+
### Unchanged
|
|
34
|
+
|
|
35
|
+
- The Android namespace stays `com.idleflowgames.playgames`, so this tree diffs
|
|
36
|
+
cleanly against the 0.2.1 tarball.
|
|
37
|
+
|
|
38
|
+
## [0.2.1] - 2026-07-30
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Android: Play Games Services v2 SDK 21.0.0 to 22.0.0. The 22.0.0 public API
|
|
43
|
+
is additive over 21.0.0 (it adds `GameStatsClient` and `PlayerGameEvent`),
|
|
44
|
+
every symbol this plugin calls is unchanged, and no plugin source changed.
|
|
45
|
+
- Android: Android Gradle Plugin 9.3.1, Kotlin Gradle Plugin 2.4.10.
|
|
46
|
+
- Toolchain to latest: TypeScript 6 to 7.0.2 (the native `tsgo` compiler),
|
|
47
|
+
Biome 2.5.6, Capacitor 8.4.2, rollup 4.62.3, rimraf 6.1.3,
|
|
48
|
+
`@capacitor/docgen` 0.3.1, pnpm 11.18.0.
|
|
49
|
+
- iOS: `capacitor-swift-pm` floor 8.4.2.
|
|
50
|
+
- CI: `actions/setup-node` v7.
|
|
51
|
+
|
|
52
|
+
### Requirements
|
|
53
|
+
|
|
54
|
+
- Android `minSdkVersion` 24. Play Games Services v2 SDK 22.0.0 raises its own
|
|
55
|
+
floor from 21 to 24, so an app that sets `minSdkVersion` below 24 fails the
|
|
56
|
+
manifest merge. This module already defaulted to 24, and Capacitor 8 requires
|
|
57
|
+
24, so an app on stock Capacitor 8 settings needs no change.
|
|
58
|
+
|
|
59
|
+
## [0.2.0] - 2026-07-12
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- `requestServerSideAccess({ serverClientId, forceRefresh? })` (Android): a
|
|
64
|
+
one-time OAuth 2.0 server auth code for the signed-in Play Games player, for a
|
|
65
|
+
backend to exchange for the authoritative player id (Play Games Services v2
|
|
66
|
+
`GamesSignInClient.requestServerSideAccess`).
|
|
67
|
+
- `fetchIdentityVerificationSignature()` (iOS): a GameKit identity-verification
|
|
68
|
+
bundle (`GKLocalPlayer.fetchItems(forIdentityVerificationSignature:)`) a backend
|
|
69
|
+
verifies against Apple's certificate to trust the Game Center player id.
|
|
70
|
+
- Both methods have a safe no-op web fallback and reject as unimplemented on the
|
|
71
|
+
non-owning native platform.
|
|
72
|
+
|
|
73
|
+
## [0.1.0] - 2026-06-20
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
|
|
77
|
+
- Initial release.
|
|
78
|
+
- Sign-in (silent + interactive) and player profile.
|
|
79
|
+
- Achievement unlock / increment and the native achievements UI.
|
|
80
|
+
- Leaderboard score submission and the native leaderboard UI.
|
|
81
|
+
- Saved Games (load / save / list / delete) with most-recently-modified conflict
|
|
82
|
+
resolution.
|
|
83
|
+
- `signInStateChanged` event for system-driven auth changes.
|
|
84
|
+
- Android via Google Play Games Services v2, iOS via Apple GameKit, with a safe
|
|
85
|
+
no-op web fallback. iOS registers via `CAPBridgedPlugin` (Capacitor 8 Swift
|
|
86
|
+
registration, no Objective-C `.m` file required).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'CapacitorPlayGames'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.homepage = 'https://github.com/modbender/capacitor-play-games'
|
|
11
|
+
s.author = 'modbender'
|
|
12
|
+
s.source = { :git => 'https://github.com/modbender/capacitor-play-games.git', :tag => s.version.to_s }
|
|
13
|
+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
+
s.ios.deployment_target = '14.0'
|
|
15
|
+
s.dependency 'Capacitor'
|
|
16
|
+
s.swift_version = '5.1'
|
|
17
|
+
end
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Idle Flow Games (original work)
|
|
4
|
+
Copyright (c) 2026 modbender (fork)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/Package.swift
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
// Package/product/target names carry the npm scope ("Modbender…") because
|
|
5
|
+
// Capacitor's `cap sync ios` derives the SwiftPM product name from the FULL
|
|
6
|
+
// scoped package name (@modbender/capacitor-play-games →
|
|
7
|
+
// ModbenderCapacitorPlayGames, PascalCased scope+name, same as
|
|
8
|
+
// @capacitor-community/admob → CapacitorCommunityAdmob). The consuming app's
|
|
9
|
+
// generated Package.swift references that derived name, so the product here must
|
|
10
|
+
// match it exactly or `xcodebuild -resolvePackageDependencies` fails with
|
|
11
|
+
// "product 'ModbenderCapacitorPlayGames' not found". The Swift module is
|
|
12
|
+
// renamed with it; nothing imports it by name and Capacitor registers the
|
|
13
|
+
// plugin via the Objective-C runtime, so the rename is source-compatible.
|
|
14
|
+
let package = Package(
|
|
15
|
+
name: "ModbenderCapacitorPlayGames",
|
|
16
|
+
platforms: [.iOS(.v14)],
|
|
17
|
+
products: [
|
|
18
|
+
.library(
|
|
19
|
+
name: "ModbenderCapacitorPlayGames",
|
|
20
|
+
targets: ["ModbenderCapacitorPlayGames"]
|
|
21
|
+
)
|
|
22
|
+
],
|
|
23
|
+
dependencies: [
|
|
24
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.4.2")
|
|
25
|
+
],
|
|
26
|
+
targets: [
|
|
27
|
+
.target(
|
|
28
|
+
name: "ModbenderCapacitorPlayGames",
|
|
29
|
+
dependencies: [
|
|
30
|
+
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
31
|
+
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
32
|
+
],
|
|
33
|
+
path: "ios/Plugin"
|
|
34
|
+
)
|
|
35
|
+
]
|
|
36
|
+
)
|