@capawesome/capacitor-age-signals 0.2.0 → 0.3.1
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/CapawesomeCapacitorAgeSignals.podspec +1 -1
- package/Package.swift +2 -2
- package/README.md +38 -1
- package/android/build.gradle +10 -10
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignalsPlugin.java +9 -0
- package/dist/docs.json +47 -0
- package/dist/esm/definitions.d.ts +23 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/AgeSignals.swift +20 -0
- package/ios/Plugin/AgeSignalsPlugin.swift +12 -1
- package/ios/Plugin/Classes/Results/CheckEligibilityResult.swift +16 -0
- package/package.json +11 -10
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '15.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapawesomeCapacitorAgeSignals",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v15)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapawesomeCapacitorAgeSignals",
|
|
10
10
|
targets: ["AgeSignalsPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/README.md
CHANGED
|
@@ -12,6 +12,13 @@ Capacitor plugin to use the [Play Age Signals API](https://developer.android.com
|
|
|
12
12
|
|
|
13
13
|
The **Play Age Signals API** is returning "Not yet implemented" because its live functionality is scheduled to begin on January 1, 2026.
|
|
14
14
|
|
|
15
|
+
## Compatibility
|
|
16
|
+
|
|
17
|
+
| Plugin Version | Capacitor Version | Status |
|
|
18
|
+
| -------------- | ----------------- | -------------- |
|
|
19
|
+
| 0.3.x | >=8.x.x | Active support |
|
|
20
|
+
| 0.2.x | 7.x.x | Deprecated |
|
|
21
|
+
|
|
15
22
|
## Installation
|
|
16
23
|
|
|
17
24
|
```bash
|
|
@@ -25,7 +32,7 @@ npx cap sync
|
|
|
25
32
|
|
|
26
33
|
If needed, you can define the following project variable in your app's `variables.gradle` file to change the default version of the dependency:
|
|
27
34
|
|
|
28
|
-
- `$androidPlayAgeSignalsVersion` version of `com.google.android.play:age-signals` (default: `0.0.
|
|
35
|
+
- `$androidPlayAgeSignalsVersion` version of `com.google.android.play:age-signals` (default: `0.0.2`)
|
|
29
36
|
|
|
30
37
|
This can be useful if you encounter dependency conflicts with other plugins in your project.
|
|
31
38
|
|
|
@@ -57,6 +64,11 @@ const checkAgeSignals = async () => {
|
|
|
57
64
|
console.log('Age Lower:', result.ageLower);
|
|
58
65
|
console.log('Age Upper:', result.ageUpper);
|
|
59
66
|
};
|
|
67
|
+
|
|
68
|
+
const checkEligibility = async () => {
|
|
69
|
+
const result = await AgeSignals.checkEligibility();
|
|
70
|
+
console.log('Is Eligible:', result.isEligible);
|
|
71
|
+
};
|
|
60
72
|
```
|
|
61
73
|
|
|
62
74
|
## API
|
|
@@ -64,6 +76,7 @@ const checkAgeSignals = async () => {
|
|
|
64
76
|
<docgen-index>
|
|
65
77
|
|
|
66
78
|
* [`checkAgeSignals(...)`](#checkagesignals)
|
|
79
|
+
* [`checkEligibility()`](#checkeligibility)
|
|
67
80
|
* [Interfaces](#interfaces)
|
|
68
81
|
* [Enums](#enums)
|
|
69
82
|
|
|
@@ -91,6 +104,23 @@ Request the user's age signals.
|
|
|
91
104
|
--------------------
|
|
92
105
|
|
|
93
106
|
|
|
107
|
+
### checkEligibility()
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
checkEligibility() => Promise<CheckEligibilityResult>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Check if the user is eligible for age-gated features.
|
|
114
|
+
|
|
115
|
+
Only available on iOS.
|
|
116
|
+
|
|
117
|
+
**Returns:** <code>Promise<<a href="#checkeligibilityresult">CheckEligibilityResult</a>></code>
|
|
118
|
+
|
|
119
|
+
**Since:** 0.3.1
|
|
120
|
+
|
|
121
|
+
--------------------
|
|
122
|
+
|
|
123
|
+
|
|
94
124
|
### Interfaces
|
|
95
125
|
|
|
96
126
|
|
|
@@ -112,6 +142,13 @@ Request the user's age signals.
|
|
|
112
142
|
| **`ageGates`** | <code>number[]</code> | The age ranges that the user falls into. The provided array must contain at least 2 and at most 3 ages. Only available on iOS. | <code>[13, 15, 18]</code> | 0.0.2 |
|
|
113
143
|
|
|
114
144
|
|
|
145
|
+
#### CheckEligibilityResult
|
|
146
|
+
|
|
147
|
+
| Prop | Type | Description | Since |
|
|
148
|
+
| ---------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
149
|
+
| **`isEligible`** | <code>boolean</code> | Whether the user is eligible for age-gated features. Returns `true` if the user is in an applicable region that requires additional age-related obligations. Always returns `false` on macOS. | 0.3.1 |
|
|
150
|
+
|
|
151
|
+
|
|
115
152
|
### Enums
|
|
116
153
|
|
|
117
154
|
|
package/android/build.gradle
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
6
|
-
androidPlayAgeSignalsVersion = project.hasProperty('androidPlayAgeSignalsVersion') ? rootProject.ext.androidPlayAgeSignalsVersion : '0.0.
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
6
|
+
androidPlayAgeSignalsVersion = project.hasProperty('androidPlayAgeSignalsVersion') ? rootProject.ext.androidPlayAgeSignalsVersion : '0.0.2'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
@@ -12,18 +12,18 @@ buildscript {
|
|
|
12
12
|
mavenCentral()
|
|
13
13
|
}
|
|
14
14
|
dependencies {
|
|
15
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
15
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
apply plugin: 'com.android.library'
|
|
20
20
|
|
|
21
21
|
android {
|
|
22
|
-
namespace "io.capawesome.capacitorjs.plugins.agesignals"
|
|
23
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
22
|
+
namespace = "io.capawesome.capacitorjs.plugins.agesignals"
|
|
23
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
24
24
|
defaultConfig {
|
|
25
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
26
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
25
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
26
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
27
27
|
versionCode 1
|
|
28
28
|
versionName "1.0"
|
|
29
29
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -35,7 +35,7 @@ android {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
lintOptions {
|
|
38
|
-
abortOnError false
|
|
38
|
+
abortOnError = false
|
|
39
39
|
}
|
|
40
40
|
compileOptions {
|
|
41
41
|
sourceCompatibility JavaVersion.VERSION_21
|
package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignalsPlugin.java
CHANGED
|
@@ -50,6 +50,11 @@ public class AgeSignalsPlugin extends Plugin {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
@PluginMethod
|
|
54
|
+
public void checkEligibility(PluginCall call) {
|
|
55
|
+
rejectCallAsUnimplemented(call);
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
private void rejectCall(@NonNull PluginCall call, @NonNull Exception exception) {
|
|
54
59
|
String message = exception.getMessage();
|
|
55
60
|
if (message == null) {
|
|
@@ -59,6 +64,10 @@ public class AgeSignalsPlugin extends Plugin {
|
|
|
59
64
|
call.reject(message);
|
|
60
65
|
}
|
|
61
66
|
|
|
67
|
+
private void rejectCallAsUnimplemented(@NonNull PluginCall call) {
|
|
68
|
+
call.unimplemented("This method is not available on this platform.");
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
private void resolveCall(@NonNull PluginCall call, @Nullable Result result) {
|
|
63
72
|
if (result == null) {
|
|
64
73
|
call.resolve();
|
package/dist/docs.json
CHANGED
|
@@ -33,6 +33,23 @@
|
|
|
33
33
|
"CheckAgeSignalsOptions"
|
|
34
34
|
],
|
|
35
35
|
"slug": "checkagesignals"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "checkEligibility",
|
|
39
|
+
"signature": "() => Promise<CheckEligibilityResult>",
|
|
40
|
+
"parameters": [],
|
|
41
|
+
"returns": "Promise<CheckEligibilityResult>",
|
|
42
|
+
"tags": [
|
|
43
|
+
{
|
|
44
|
+
"name": "since",
|
|
45
|
+
"text": "0.3.1"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"docs": "Check if the user is eligible for age-gated features.\n\nOnly available on iOS.",
|
|
49
|
+
"complexTypes": [
|
|
50
|
+
"CheckEligibilityResult"
|
|
51
|
+
],
|
|
52
|
+
"slug": "checkeligibility"
|
|
36
53
|
}
|
|
37
54
|
],
|
|
38
55
|
"properties": []
|
|
@@ -159,6 +176,36 @@
|
|
|
159
176
|
"type": "number[] | undefined"
|
|
160
177
|
}
|
|
161
178
|
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "CheckEligibilityResult",
|
|
182
|
+
"slug": "checkeligibilityresult",
|
|
183
|
+
"docs": "",
|
|
184
|
+
"tags": [
|
|
185
|
+
{
|
|
186
|
+
"text": "0.3.1",
|
|
187
|
+
"name": "since"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"methods": [],
|
|
191
|
+
"properties": [
|
|
192
|
+
{
|
|
193
|
+
"name": "isEligible",
|
|
194
|
+
"tags": [
|
|
195
|
+
{
|
|
196
|
+
"text": "0.3.1",
|
|
197
|
+
"name": "since"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"text": "true",
|
|
201
|
+
"name": "example"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"docs": "Whether the user is eligible for age-gated features.\n\nReturns `true` if the user is in an applicable region that requires\nadditional age-related obligations. Always returns `false` on macOS.",
|
|
205
|
+
"complexTypes": [],
|
|
206
|
+
"type": "boolean"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
162
209
|
}
|
|
163
210
|
],
|
|
164
211
|
"enums": [
|
|
@@ -8,6 +8,14 @@ export interface AgeSignalsPlugin {
|
|
|
8
8
|
* @since 0.0.1
|
|
9
9
|
*/
|
|
10
10
|
checkAgeSignals(options?: CheckAgeSignalsOptions): Promise<CheckAgeSignalsResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Check if the user is eligible for age-gated features.
|
|
13
|
+
*
|
|
14
|
+
* Only available on iOS.
|
|
15
|
+
*
|
|
16
|
+
* @since 0.3.1
|
|
17
|
+
*/
|
|
18
|
+
checkEligibility(): Promise<CheckEligibilityResult>;
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
21
|
* @since 0.0.2
|
|
@@ -76,6 +84,21 @@ export interface CheckAgeSignalsResult {
|
|
|
76
84
|
*/
|
|
77
85
|
installId?: string;
|
|
78
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* @since 0.3.1
|
|
89
|
+
*/
|
|
90
|
+
export interface CheckEligibilityResult {
|
|
91
|
+
/**
|
|
92
|
+
* Whether the user is eligible for age-gated features.
|
|
93
|
+
*
|
|
94
|
+
* Returns `true` if the user is in an applicable region that requires
|
|
95
|
+
* additional age-related obligations. Always returns `false` on macOS.
|
|
96
|
+
*
|
|
97
|
+
* @since 0.3.1
|
|
98
|
+
* @example true
|
|
99
|
+
*/
|
|
100
|
+
isEligible: boolean;
|
|
101
|
+
}
|
|
79
102
|
/**
|
|
80
103
|
* @since 0.0.1
|
|
81
104
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA2GA;;GAEG;AACH,MAAM,CAAN,IAAY,UA2CX;AA3CD,WAAY,UAAU;IACpB;;;;OAIG;IACH,mCAAqB,CAAA;IACrB;;;;;OAKG;IACH,uCAAyB,CAAA;IACzB;;;;;;OAMG;IACH,uEAAyD,CAAA;IACzD;;;;;;OAMG;IACH,qEAAuD,CAAA;IACvD;;;;;OAKG;IACH,iCAAmB,CAAA;IACnB;;;;OAIG;IACH,6BAAe,CAAA;AACjB,CAAC,EA3CW,UAAU,KAAV,UAAU,QA2CrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SA6DX;AA7DD,WAAY,SAAS;IACnB;;;;OAIG;IACH,kDAAqC,CAAA;IACrC;;;;OAIG;IACH,uDAA0C,CAAA;IAC1C;;;;OAIG;IACH,2CAA8B,CAAA;IAC9B;;;;OAIG;IACH,6DAAgD,CAAA;IAChD;;;;OAIG;IACH,2DAA8C,CAAA;IAC9C;;;;OAIG;IACH,qEAAwD,CAAA;IACxD;;;;OAIG;IACH,2EAA8D,CAAA;IAC9D;;;;OAIG;IACH,4DAA+C,CAAA;IAC/C;;;;OAIG;IACH,0CAA6B,CAAA;IAC7B;;;;OAIG;IACH,6CAAgC,CAAA;AAClC,CAAC,EA7DW,SAAS,KAAT,SAAS,QA6DpB","sourcesContent":["/**\n * @since 0.0.1\n */\nexport interface AgeSignalsPlugin {\n /**\n * Request the user's age signals.\n *\n * @since 0.0.1\n */\n checkAgeSignals(\n options?: CheckAgeSignalsOptions,\n ): Promise<CheckAgeSignalsResult>;\n /**\n * Check if the user is eligible for age-gated features.\n *\n * Only available on iOS.\n *\n * @since 0.3.1\n */\n checkEligibility(): Promise<CheckEligibilityResult>;\n}\n\n/**\n * @since 0.0.2\n */\nexport interface CheckAgeSignalsOptions {\n /**\n * The age ranges that the user falls into.\n * The provided array must contain at least 2 and at most 3 ages.\n *\n * Only available on iOS.\n *\n * @since 0.0.2\n * @default [13, 15, 18]\n */\n ageGates?: number[];\n}\n\n/**\n * @since 0.0.1\n */\nexport interface CheckAgeSignalsResult {\n /**\n * The user's verification status.\n *\n * @since 0.0.1\n */\n userStatus: UserStatus;\n /**\n * The (inclusive) lower bound of a supervised user's age range.\n *\n * Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`.\n *\n * @since 0.0.1\n * @example 13\n */\n ageLower?: number;\n /**\n * The (inclusive) upper bound of a supervised user's age range.\n *\n * Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED` and the user's age is under 18.\n *\n * @since 0.0.1\n * @example 15\n */\n ageUpper?: number;\n /**\n * The effective from date of the most recent significant change that was approved.\n * When an app is installed, the date of the most recent significant change prior to install is used.\n *\n * Only available when `userStatus` is `SUPERVISED_APPROVAL_PENDING` or `SUPERVISED_APPROVAL_DENIED`.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n * @example \"2024-01-15\"\n */\n mostRecentApprovalDate?: string;\n /**\n * An ID assigned to supervised user installs by Google Play, used for the purposes of notifying you of revoked app approval.\n *\n * Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`.\n *\n * Only available on Android.\n *\n * @since 0.0.1\n * @example \"abc123xyz\"\n */\n installId?: string;\n}\n\n/**\n * @since 0.3.1\n */\nexport interface CheckEligibilityResult {\n /**\n * Whether the user is eligible for age-gated features.\n *\n * Returns `true` if the user is in an applicable region that requires\n * additional age-related obligations. Always returns `false` on macOS.\n *\n * @since 0.3.1\n * @example true\n */\n isEligible: boolean;\n}\n\n/**\n * @since 0.0.1\n */\nexport enum UserStatus {\n /**\n * The user is over 18. Google verified the user's age using a commercially reasonable method such as a government-issued ID, credit card, or facial age estimation.\n *\n * @since 0.0.1\n */\n Verified = 'VERIFIED',\n /**\n * The user has a supervised Google Account managed by a parent who sets their age.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n *\n * @since 0.0.1\n */\n Supervised = 'SUPERVISED',\n /**\n * The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n SupervisedApprovalPending = 'SUPERVISED_APPROVAL_PENDING',\n /**\n * The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n SupervisedApprovalDenied = 'SUPERVISED_APPROVAL_DENIED',\n /**\n * The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18.\n * To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.\n *\n * @since 0.0.1\n */\n Unknown = 'UNKNOWN',\n /**\n * All other users return this value.\n *\n * @since 0.0.1\n */\n Empty = 'EMPTY',\n}\n\n/**\n * @since 0.0.1\n */\nexport enum ErrorCode {\n /**\n * The Play Age Signals API is not available. The Play Store app version installed on the device might be old.\n *\n * @since 0.0.1\n */\n ApiNotAvailable = 'API_NOT_AVAILABLE',\n /**\n * No Play Store app is found on the device.\n *\n * @since 0.0.1\n */\n PlayStoreNotFound = 'PLAY_STORE_NOT_FOUND',\n /**\n * No available network is found.\n *\n * @since 0.0.1\n */\n NetworkError = 'NETWORK_ERROR',\n /**\n * Play Services is not available or its version is too old.\n *\n * @since 0.0.1\n */\n PlayServicesNotFound = 'PLAY_SERVICES_NOT_FOUND',\n /**\n * Binding to the service in the Play Store has failed. This can be due to having an old Play Store version installed on the device or device memory is overloaded.\n *\n * @since 0.0.1\n */\n CannotBindToService = 'CANNOT_BIND_TO_SERVICE',\n /**\n * The Play Store app needs to be updated.\n *\n * @since 0.0.1\n */\n PlayStoreVersionOutdated = 'PLAY_STORE_VERSION_OUTDATED',\n /**\n * Play Services needs to be updated.\n *\n * @since 0.0.1\n */\n PlayServicesVersionOutdated = 'PLAY_SERVICES_VERSION_OUTDATED',\n /**\n * There was a transient error in the client device.\n *\n * @since 0.0.1\n */\n ClientTransientError = 'CLIENT_TRANSIENT_ERROR',\n /**\n * The app was not installed by Google Play.\n *\n * @since 0.0.1\n */\n AppNotOwned = 'APP_NOT_OWNED',\n /**\n * Unknown internal error.\n *\n * @since 0.0.1\n */\n InternalError = 'INTERNAL_ERROR',\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { AgeSignalsPlugin, CheckAgeSignalsOptions, CheckAgeSignalsResult } from './definitions';
|
|
2
|
+
import type { AgeSignalsPlugin, CheckAgeSignalsOptions, CheckAgeSignalsResult, CheckEligibilityResult } from './definitions';
|
|
3
3
|
export declare class AgeSignalsWeb extends WebPlugin implements AgeSignalsPlugin {
|
|
4
4
|
checkAgeSignals(_options: CheckAgeSignalsOptions): Promise<CheckAgeSignalsResult>;
|
|
5
|
+
checkEligibility(): Promise<CheckEligibilityResult>;
|
|
5
6
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -3,5 +3,8 @@ export class AgeSignalsWeb extends WebPlugin {
|
|
|
3
3
|
async checkAgeSignals(_options) {
|
|
4
4
|
throw this.unimplemented('Not implemented on web.');
|
|
5
5
|
}
|
|
6
|
+
async checkEligibility() {
|
|
7
|
+
throw this.unimplemented('Not implemented on web.');
|
|
8
|
+
}
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC1C,KAAK,CAAC,eAAe,CACnB,QAAgC;QAEhC,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n AgeSignalsPlugin,\n CheckAgeSignalsOptions,\n CheckAgeSignalsResult,\n CheckEligibilityResult,\n} from './definitions';\n\nexport class AgeSignalsWeb extends WebPlugin implements AgeSignalsPlugin {\n async checkAgeSignals(\n _options: CheckAgeSignalsOptions,\n ): Promise<CheckAgeSignalsResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async checkEligibility(): Promise<CheckEligibilityResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -125,6 +125,9 @@ class AgeSignalsWeb extends core.WebPlugin {
|
|
|
125
125
|
async checkAgeSignals(_options) {
|
|
126
126
|
throw this.unimplemented('Not implemented on web.');
|
|
127
127
|
}
|
|
128
|
+
async checkEligibility() {
|
|
129
|
+
throw this.unimplemented('Not implemented on web.');
|
|
130
|
+
}
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.0.1\n */\nexport var UserStatus;\n(function (UserStatus) {\n /**\n * The user is over 18. Google verified the user's age using a commercially reasonable method such as a government-issued ID, credit card, or facial age estimation.\n *\n * @since 0.0.1\n */\n UserStatus[\"Verified\"] = \"VERIFIED\";\n /**\n * The user has a supervised Google Account managed by a parent who sets their age.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n *\n * @since 0.0.1\n */\n UserStatus[\"Supervised\"] = \"SUPERVISED\";\n /**\n * The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalPending\"] = \"SUPERVISED_APPROVAL_PENDING\";\n /**\n * The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalDenied\"] = \"SUPERVISED_APPROVAL_DENIED\";\n /**\n * The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18.\n * To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.\n *\n * @since 0.0.1\n */\n UserStatus[\"Unknown\"] = \"UNKNOWN\";\n /**\n * All other users return this value.\n *\n * @since 0.0.1\n */\n UserStatus[\"Empty\"] = \"EMPTY\";\n})(UserStatus || (UserStatus = {}));\n/**\n * @since 0.0.1\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The Play Age Signals API is not available. The Play Store app version installed on the device might be old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ApiNotAvailable\"] = \"API_NOT_AVAILABLE\";\n /**\n * No Play Store app is found on the device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreNotFound\"] = \"PLAY_STORE_NOT_FOUND\";\n /**\n * No available network is found.\n *\n * @since 0.0.1\n */\n ErrorCode[\"NetworkError\"] = \"NETWORK_ERROR\";\n /**\n * Play Services is not available or its version is too old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesNotFound\"] = \"PLAY_SERVICES_NOT_FOUND\";\n /**\n * Binding to the service in the Play Store has failed. This can be due to having an old Play Store version installed on the device or device memory is overloaded.\n *\n * @since 0.0.1\n */\n ErrorCode[\"CannotBindToService\"] = \"CANNOT_BIND_TO_SERVICE\";\n /**\n * The Play Store app needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreVersionOutdated\"] = \"PLAY_STORE_VERSION_OUTDATED\";\n /**\n * Play Services needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesVersionOutdated\"] = \"PLAY_SERVICES_VERSION_OUTDATED\";\n /**\n * There was a transient error in the client device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ClientTransientError\"] = \"CLIENT_TRANSIENT_ERROR\";\n /**\n * The app was not installed by Google Play.\n *\n * @since 0.0.1\n */\n ErrorCode[\"AppNotOwned\"] = \"APP_NOT_OWNED\";\n /**\n * Unknown internal error.\n *\n * @since 0.0.1\n */\n ErrorCode[\"InternalError\"] = \"INTERNAL_ERROR\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AgeSignals = registerPlugin('AgeSignals', {\n web: () => import('./web').then(m => new m.AgeSignalsWeb()),\n});\nexport * from './definitions';\nexport { AgeSignals };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AgeSignalsWeb extends WebPlugin {\n async checkAgeSignals(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["UserStatus","ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,UAAU,EAAE;AACvB;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,YAAY;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,2BAA2B,CAAC,GAAG,6BAA6B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,0BAA0B,CAAC,GAAG,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO;AACjC,CAAC,EAAEA,kBAAU,KAAKA,kBAAU,GAAG,EAAE,CAAC,CAAC;AACnC;AACA;AACA;AACWC;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GAAG,sBAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,qBAAqB,CAAC,GAAG,wBAAwB;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,0BAA0B,CAAC,GAAG,6BAA6B;AACzE;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,6BAA6B,CAAC,GAAG,gCAAgC;AAC/E;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,gBAAgB;AACjD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChH5B,MAAC,UAAU,GAAGC,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;AAC/D,CAAC;;ACFM,MAAM,aAAa,SAASC,cAAS,CAAC;AAC7C,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;AACpC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D;
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.0.1\n */\nexport var UserStatus;\n(function (UserStatus) {\n /**\n * The user is over 18. Google verified the user's age using a commercially reasonable method such as a government-issued ID, credit card, or facial age estimation.\n *\n * @since 0.0.1\n */\n UserStatus[\"Verified\"] = \"VERIFIED\";\n /**\n * The user has a supervised Google Account managed by a parent who sets their age.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n *\n * @since 0.0.1\n */\n UserStatus[\"Supervised\"] = \"SUPERVISED\";\n /**\n * The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalPending\"] = \"SUPERVISED_APPROVAL_PENDING\";\n /**\n * The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalDenied\"] = \"SUPERVISED_APPROVAL_DENIED\";\n /**\n * The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18.\n * To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.\n *\n * @since 0.0.1\n */\n UserStatus[\"Unknown\"] = \"UNKNOWN\";\n /**\n * All other users return this value.\n *\n * @since 0.0.1\n */\n UserStatus[\"Empty\"] = \"EMPTY\";\n})(UserStatus || (UserStatus = {}));\n/**\n * @since 0.0.1\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The Play Age Signals API is not available. The Play Store app version installed on the device might be old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ApiNotAvailable\"] = \"API_NOT_AVAILABLE\";\n /**\n * No Play Store app is found on the device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreNotFound\"] = \"PLAY_STORE_NOT_FOUND\";\n /**\n * No available network is found.\n *\n * @since 0.0.1\n */\n ErrorCode[\"NetworkError\"] = \"NETWORK_ERROR\";\n /**\n * Play Services is not available or its version is too old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesNotFound\"] = \"PLAY_SERVICES_NOT_FOUND\";\n /**\n * Binding to the service in the Play Store has failed. This can be due to having an old Play Store version installed on the device or device memory is overloaded.\n *\n * @since 0.0.1\n */\n ErrorCode[\"CannotBindToService\"] = \"CANNOT_BIND_TO_SERVICE\";\n /**\n * The Play Store app needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreVersionOutdated\"] = \"PLAY_STORE_VERSION_OUTDATED\";\n /**\n * Play Services needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesVersionOutdated\"] = \"PLAY_SERVICES_VERSION_OUTDATED\";\n /**\n * There was a transient error in the client device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ClientTransientError\"] = \"CLIENT_TRANSIENT_ERROR\";\n /**\n * The app was not installed by Google Play.\n *\n * @since 0.0.1\n */\n ErrorCode[\"AppNotOwned\"] = \"APP_NOT_OWNED\";\n /**\n * Unknown internal error.\n *\n * @since 0.0.1\n */\n ErrorCode[\"InternalError\"] = \"INTERNAL_ERROR\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AgeSignals = registerPlugin('AgeSignals', {\n web: () => import('./web').then(m => new m.AgeSignalsWeb()),\n});\nexport * from './definitions';\nexport { AgeSignals };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AgeSignalsWeb extends WebPlugin {\n async checkAgeSignals(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkEligibility() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["UserStatus","ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,UAAU,EAAE;AACvB;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,YAAY;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,2BAA2B,CAAC,GAAG,6BAA6B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,0BAA0B,CAAC,GAAG,4BAA4B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO;AACjC,CAAC,EAAEA,kBAAU,KAAKA,kBAAU,GAAG,EAAE,CAAC,CAAC;AACnC;AACA;AACA;AACWC;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GAAG,sBAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,eAAe;AAC/C;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,qBAAqB,CAAC,GAAG,wBAAwB;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,0BAA0B,CAAC,GAAG,6BAA6B;AACzE;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,6BAA6B,CAAC,GAAG,gCAAgC;AAC/E;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,gBAAgB;AACjD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChH5B,MAAC,UAAU,GAAGC,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;AAC/D,CAAC;;ACFM,MAAM,aAAa,SAASC,cAAS,CAAC;AAC7C,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;AACpC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -124,6 +124,9 @@ var capacitorAgeSignals = (function (exports, core) {
|
|
|
124
124
|
async checkAgeSignals(_options) {
|
|
125
125
|
throw this.unimplemented('Not implemented on web.');
|
|
126
126
|
}
|
|
127
|
+
async checkEligibility() {
|
|
128
|
+
throw this.unimplemented('Not implemented on web.');
|
|
129
|
+
}
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.0.1\n */\nexport var UserStatus;\n(function (UserStatus) {\n /**\n * The user is over 18. Google verified the user's age using a commercially reasonable method such as a government-issued ID, credit card, or facial age estimation.\n *\n * @since 0.0.1\n */\n UserStatus[\"Verified\"] = \"VERIFIED\";\n /**\n * The user has a supervised Google Account managed by a parent who sets their age.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n *\n * @since 0.0.1\n */\n UserStatus[\"Supervised\"] = \"SUPERVISED\";\n /**\n * The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalPending\"] = \"SUPERVISED_APPROVAL_PENDING\";\n /**\n * The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalDenied\"] = \"SUPERVISED_APPROVAL_DENIED\";\n /**\n * The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18.\n * To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.\n *\n * @since 0.0.1\n */\n UserStatus[\"Unknown\"] = \"UNKNOWN\";\n /**\n * All other users return this value.\n *\n * @since 0.0.1\n */\n UserStatus[\"Empty\"] = \"EMPTY\";\n})(UserStatus || (UserStatus = {}));\n/**\n * @since 0.0.1\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The Play Age Signals API is not available. The Play Store app version installed on the device might be old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ApiNotAvailable\"] = \"API_NOT_AVAILABLE\";\n /**\n * No Play Store app is found on the device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreNotFound\"] = \"PLAY_STORE_NOT_FOUND\";\n /**\n * No available network is found.\n *\n * @since 0.0.1\n */\n ErrorCode[\"NetworkError\"] = \"NETWORK_ERROR\";\n /**\n * Play Services is not available or its version is too old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesNotFound\"] = \"PLAY_SERVICES_NOT_FOUND\";\n /**\n * Binding to the service in the Play Store has failed. This can be due to having an old Play Store version installed on the device or device memory is overloaded.\n *\n * @since 0.0.1\n */\n ErrorCode[\"CannotBindToService\"] = \"CANNOT_BIND_TO_SERVICE\";\n /**\n * The Play Store app needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreVersionOutdated\"] = \"PLAY_STORE_VERSION_OUTDATED\";\n /**\n * Play Services needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesVersionOutdated\"] = \"PLAY_SERVICES_VERSION_OUTDATED\";\n /**\n * There was a transient error in the client device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ClientTransientError\"] = \"CLIENT_TRANSIENT_ERROR\";\n /**\n * The app was not installed by Google Play.\n *\n * @since 0.0.1\n */\n ErrorCode[\"AppNotOwned\"] = \"APP_NOT_OWNED\";\n /**\n * Unknown internal error.\n *\n * @since 0.0.1\n */\n ErrorCode[\"InternalError\"] = \"INTERNAL_ERROR\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AgeSignals = registerPlugin('AgeSignals', {\n web: () => import('./web').then(m => new m.AgeSignalsWeb()),\n});\nexport * from './definitions';\nexport { AgeSignals };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AgeSignalsWeb extends WebPlugin {\n async checkAgeSignals(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["UserStatus","ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,UAAU,EAAE;IACvB;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU;IACvC;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,YAAY;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,2BAA2B,CAAC,GAAG,6BAA6B;IAC3E;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,0BAA0B,CAAC,GAAG,4BAA4B;IACzE;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS;IACrC;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO;IACjC,CAAC,EAAEA,kBAAU,KAAKA,kBAAU,GAAG,EAAE,CAAC,CAAC;IACnC;IACA;IACA;AACWC;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;IACtD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GAAG,sBAAsB;IAC3D;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,eAAe;IAC/C;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,yBAAyB;IACjE;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,qBAAqB,CAAC,GAAG,wBAAwB;IAC/D;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,0BAA0B,CAAC,GAAG,6BAA6B;IACzE;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,6BAA6B,CAAC,GAAG,gCAAgC;IAC/E;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,wBAAwB;IAChE;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,eAAe;IAC9C;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,gBAAgB;IACjD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChH5B,UAAC,UAAU,GAAGC,mBAAc,CAAC,YAAY,EAAE;IAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IAC/D,CAAC;;ICFM,MAAM,aAAa,SAASC,cAAS,CAAC;IAC7C,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;IACpC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D;
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.0.1\n */\nexport var UserStatus;\n(function (UserStatus) {\n /**\n * The user is over 18. Google verified the user's age using a commercially reasonable method such as a government-issued ID, credit card, or facial age estimation.\n *\n * @since 0.0.1\n */\n UserStatus[\"Verified\"] = \"VERIFIED\";\n /**\n * The user has a supervised Google Account managed by a parent who sets their age.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n *\n * @since 0.0.1\n */\n UserStatus[\"Supervised\"] = \"SUPERVISED\";\n /**\n * The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalPending\"] = \"SUPERVISED_APPROVAL_PENDING\";\n /**\n * The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes.\n * Use `ageLower` and `ageUpper` to determine the user's age range.\n * Use `mostRecentApprovalDate` to determine the last significant change that was approved.\n *\n * @since 0.0.1\n */\n UserStatus[\"SupervisedApprovalDenied\"] = \"SUPERVISED_APPROVAL_DENIED\";\n /**\n * The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18.\n * To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.\n *\n * @since 0.0.1\n */\n UserStatus[\"Unknown\"] = \"UNKNOWN\";\n /**\n * All other users return this value.\n *\n * @since 0.0.1\n */\n UserStatus[\"Empty\"] = \"EMPTY\";\n})(UserStatus || (UserStatus = {}));\n/**\n * @since 0.0.1\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The Play Age Signals API is not available. The Play Store app version installed on the device might be old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ApiNotAvailable\"] = \"API_NOT_AVAILABLE\";\n /**\n * No Play Store app is found on the device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreNotFound\"] = \"PLAY_STORE_NOT_FOUND\";\n /**\n * No available network is found.\n *\n * @since 0.0.1\n */\n ErrorCode[\"NetworkError\"] = \"NETWORK_ERROR\";\n /**\n * Play Services is not available or its version is too old.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesNotFound\"] = \"PLAY_SERVICES_NOT_FOUND\";\n /**\n * Binding to the service in the Play Store has failed. This can be due to having an old Play Store version installed on the device or device memory is overloaded.\n *\n * @since 0.0.1\n */\n ErrorCode[\"CannotBindToService\"] = \"CANNOT_BIND_TO_SERVICE\";\n /**\n * The Play Store app needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayStoreVersionOutdated\"] = \"PLAY_STORE_VERSION_OUTDATED\";\n /**\n * Play Services needs to be updated.\n *\n * @since 0.0.1\n */\n ErrorCode[\"PlayServicesVersionOutdated\"] = \"PLAY_SERVICES_VERSION_OUTDATED\";\n /**\n * There was a transient error in the client device.\n *\n * @since 0.0.1\n */\n ErrorCode[\"ClientTransientError\"] = \"CLIENT_TRANSIENT_ERROR\";\n /**\n * The app was not installed by Google Play.\n *\n * @since 0.0.1\n */\n ErrorCode[\"AppNotOwned\"] = \"APP_NOT_OWNED\";\n /**\n * Unknown internal error.\n *\n * @since 0.0.1\n */\n ErrorCode[\"InternalError\"] = \"INTERNAL_ERROR\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AgeSignals = registerPlugin('AgeSignals', {\n web: () => import('./web').then(m => new m.AgeSignalsWeb()),\n});\nexport * from './definitions';\nexport { AgeSignals };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AgeSignalsWeb extends WebPlugin {\n async checkAgeSignals(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkEligibility() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["UserStatus","ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,UAAU,EAAE;IACvB;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU;IACvC;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,YAAY;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,2BAA2B,CAAC,GAAG,6BAA6B;IAC3E;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,0BAA0B,CAAC,GAAG,4BAA4B;IACzE;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS;IACrC;IACA;IACA;IACA;IACA;IACA,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO;IACjC,CAAC,EAAEA,kBAAU,KAAKA,kBAAU,GAAG,EAAE,CAAC,CAAC;IACnC;IACA;IACA;AACWC;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,iBAAiB,CAAC,GAAG,mBAAmB;IACtD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GAAG,sBAAsB;IAC3D;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,cAAc,CAAC,GAAG,eAAe;IAC/C;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,yBAAyB;IACjE;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,qBAAqB,CAAC,GAAG,wBAAwB;IAC/D;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,0BAA0B,CAAC,GAAG,6BAA6B;IACzE;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,6BAA6B,CAAC,GAAG,gCAAgC;IAC/E;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,sBAAsB,CAAC,GAAG,wBAAwB;IAChE;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,eAAe;IAC9C;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,eAAe,CAAC,GAAG,gBAAgB;IACjD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChH5B,UAAC,UAAU,GAAGC,mBAAc,CAAC,YAAY,EAAE;IAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IAC/D,CAAC;;ICFM,MAAM,aAAa,SAASC,cAAS,CAAC;IAC7C,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;IACpC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -53,6 +53,26 @@ import DeclaredAgeRange
|
|
|
53
53
|
#endif
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
@objc func checkEligibility(completion: @escaping (CheckEligibilityResult?, Error?) -> Void) {
|
|
57
|
+
#if canImport(DeclaredAgeRange)
|
|
58
|
+
if #available(iOS 26.2, *) {
|
|
59
|
+
Task { @MainActor in
|
|
60
|
+
do {
|
|
61
|
+
let isEligible = try await AgeRangeService.shared.isEligibleForAgeFeatures
|
|
62
|
+
let result = CheckEligibilityResult(isEligible: isEligible)
|
|
63
|
+
completion(result, nil)
|
|
64
|
+
} catch {
|
|
65
|
+
completion(nil, CustomError.apiNotAvailable)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
completion(nil, CustomError.apiNotAvailable)
|
|
70
|
+
}
|
|
71
|
+
#else
|
|
72
|
+
completion(nil, CustomError.apiNotAvailable)
|
|
73
|
+
#endif
|
|
74
|
+
}
|
|
75
|
+
|
|
56
76
|
#if canImport(DeclaredAgeRange)
|
|
57
77
|
@available(iOS 26.0, *)
|
|
58
78
|
private static func mapResponseToResult(
|
|
@@ -6,7 +6,8 @@ public class AgeSignalsPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
6
6
|
public let identifier = "AgeSignalsPlugin"
|
|
7
7
|
public let jsName = "AgeSignals"
|
|
8
8
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
9
|
-
CAPPluginMethod(name: "checkAgeSignals", returnType: CAPPluginReturnPromise)
|
|
9
|
+
CAPPluginMethod(name: "checkAgeSignals", returnType: CAPPluginReturnPromise),
|
|
10
|
+
CAPPluginMethod(name: "checkEligibility", returnType: CAPPluginReturnPromise)
|
|
10
11
|
]
|
|
11
12
|
|
|
12
13
|
public static let tag = "AgeSignalsPlugin"
|
|
@@ -32,6 +33,16 @@ public class AgeSignalsPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
@objc func checkEligibility(_ call: CAPPluginCall) {
|
|
37
|
+
implementation?.checkEligibility { result, error in
|
|
38
|
+
if let error = error {
|
|
39
|
+
self.rejectCall(call, error)
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
self.resolveCall(call, result)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
35
46
|
private func rejectCall(_ call: CAPPluginCall, _ error: Error) {
|
|
36
47
|
CAPLog.print("[", AgeSignalsPlugin.tag, "] ", error)
|
|
37
48
|
call.reject(error.localizedDescription)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
@objc public class CheckEligibilityResult: NSObject, Result {
|
|
5
|
+
let isEligible: Bool
|
|
6
|
+
|
|
7
|
+
init(isEligible: Bool) {
|
|
8
|
+
self.isEligible = isEligible
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@objc public func toJSObject() -> AnyObject {
|
|
12
|
+
var result = JSObject()
|
|
13
|
+
result["isEligible"] = isEligible
|
|
14
|
+
return result as AnyObject
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/capacitor-age-signals",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Capacitor plugin to use the Play Age Signals API to retrieve age-related signals for users.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"url": "https://opencollective.com/capawesome"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
|
+
"homepage": "https://capawesome.io/plugins/age-signals/",
|
|
36
37
|
"keywords": [
|
|
37
38
|
"capacitor",
|
|
38
39
|
"plugin",
|
|
@@ -57,23 +58,23 @@
|
|
|
57
58
|
"prepublishOnly": "npm run build"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
|
-
"@capacitor/android": "
|
|
61
|
-
"@capacitor/cli": "
|
|
62
|
-
"@capacitor/core": "
|
|
63
|
-
"@capacitor/docgen": "0.3.
|
|
64
|
-
"@capacitor/ios": "
|
|
61
|
+
"@capacitor/android": "8.0.0",
|
|
62
|
+
"@capacitor/cli": "8.0.0",
|
|
63
|
+
"@capacitor/core": "8.0.0",
|
|
64
|
+
"@capacitor/docgen": "0.3.1",
|
|
65
|
+
"@capacitor/ios": "8.0.0",
|
|
65
66
|
"@ionic/eslint-config": "0.4.0",
|
|
66
67
|
"@ionic/swiftlint-config": "2.0.0",
|
|
67
68
|
"eslint": "8.57.0",
|
|
68
69
|
"prettier": "3.4.2",
|
|
69
70
|
"prettier-plugin-java": "2.6.7",
|
|
70
|
-
"rimraf": "6.
|
|
71
|
-
"rollup": "4.
|
|
71
|
+
"rimraf": "6.1.2",
|
|
72
|
+
"rollup": "4.53.3",
|
|
72
73
|
"swiftlint": "2.0.0",
|
|
73
|
-
"typescript": "
|
|
74
|
+
"typescript": "5.9.3"
|
|
74
75
|
},
|
|
75
76
|
"peerDependencies": {
|
|
76
|
-
"@capacitor/core": ">=
|
|
77
|
+
"@capacitor/core": ">=8.0.0"
|
|
77
78
|
},
|
|
78
79
|
"swiftlint": "@ionic/swiftlint-config",
|
|
79
80
|
"eslintConfig": {
|