@capawesome/capacitor-age-signals 0.3.2 โ 0.4.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/README.md +42 -15
- package/android/build.gradle +2 -2
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignals.java +2 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/CustomExceptions.java +4 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/options/SetNextAgeSignalsExceptionOptions.java +2 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/options/SetNextAgeSignalsResultOptions.java +5 -2
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/results/CheckAgeSignalsResult.java +16 -6
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/enums/UserStatus.java +1 -0
- package/dist/docs.json +77 -2
- package/dist/esm/definitions.d.ts +50 -3
- package/dist/esm/definitions.js +42 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/plugin.cjs.js +42 -2
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +42 -2
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/AgeSignals.swift +24 -1
- package/ios/Plugin/Classes/Results/CheckAgeSignalsResult.swift +5 -1
- package/ios/Plugin/Enums/AgeRangeDeclaration.swift +5 -0
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -8,10 +8,6 @@ Capacitor plugin to use the [Play Age Signals API](https://developer.android.com
|
|
|
8
8
|
</a>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
???+ info "Important Notice"
|
|
12
|
-
|
|
13
|
-
The **Play Age Signals API** is returning "Not yet implemented" because its live functionality is scheduled to begin on January 1, 2026.
|
|
14
|
-
|
|
15
11
|
## Features
|
|
16
12
|
|
|
17
13
|
We are proud to offer one of the most complete and feature-rich Capacitor plugins for age verification. Here are some of the key features:
|
|
@@ -21,11 +17,15 @@ We are proud to offer one of the most complete and feature-rich Capacitor plugin
|
|
|
21
17
|
- ๐จโ๐ฉโ๐งโ๐ฆ **Parental Controls**: Support for supervised accounts with parental approval status.
|
|
22
18
|
- ๐งช **Testing Support**: Built-in `FakeAgeSignalsManager` integration for testing different age verification scenarios (Android).
|
|
23
19
|
- ๐ **Compliance Ready**: Built for US state age verification requirements (effective January 1, 2026).
|
|
24
|
-
- ๐ฆ **SPM**: Supports Swift Package Manager for iOS.
|
|
20
|
+
- ๐ฆ **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
|
|
25
21
|
- ๐ **Up-to-date**: Always supports the latest Capacitor version.
|
|
26
22
|
|
|
27
23
|
Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!
|
|
28
24
|
|
|
25
|
+
## Newsletter
|
|
26
|
+
|
|
27
|
+
Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).
|
|
28
|
+
|
|
29
29
|
## Compatibility
|
|
30
30
|
|
|
31
31
|
| Plugin Version | Capacitor Version | Status |
|
|
@@ -35,6 +35,21 @@ Missing a feature? Just [open an issue](https://github.com/capawesome-team/capac
|
|
|
35
35
|
|
|
36
36
|
## Installation
|
|
37
37
|
|
|
38
|
+
You can use our **AI-Assisted Setup** to install the plugin.
|
|
39
|
+
Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx skills add capawesome-team/skills --skill capacitor-plugins
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then use the following prompt:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-age-signals` plugin in my project.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:
|
|
52
|
+
|
|
38
53
|
```bash
|
|
39
54
|
npm install @capawesome/capacitor-age-signals
|
|
40
55
|
npx cap sync
|
|
@@ -46,7 +61,7 @@ npx cap sync
|
|
|
46
61
|
|
|
47
62
|
If needed, you can define the following project variable in your app's `variables.gradle` file to change the default version of the dependency:
|
|
48
63
|
|
|
49
|
-
- `$androidPlayAgeSignalsVersion` version of `com.google.android.play:age-signals` (default: `0.0.
|
|
64
|
+
- `$androidPlayAgeSignalsVersion` version of `com.google.android.play:age-signals` (default: `0.0.3`)
|
|
50
65
|
|
|
51
66
|
This can be useful if you encounter dependency conflicts with other plugins in your project.
|
|
52
67
|
|
|
@@ -301,13 +316,14 @@ Only available on Android.
|
|
|
301
316
|
|
|
302
317
|
#### CheckAgeSignalsResult
|
|
303
318
|
|
|
304
|
-
| Prop | Type
|
|
305
|
-
| ---------------------------- |
|
|
306
|
-
| **`userStatus`** | <code><a href="#userstatus">UserStatus</a></code>
|
|
307
|
-
| **`ageLower`** | <code>number</code>
|
|
308
|
-
| **`ageUpper`** | <code>number</code>
|
|
309
|
-
| **`mostRecentApprovalDate`** | <code>string</code>
|
|
310
|
-
| **`installId`** | <code>string</code>
|
|
319
|
+
| Prop | Type | Description | Since |
|
|
320
|
+
| ---------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
321
|
+
| **`userStatus`** | <code><a href="#userstatus">UserStatus</a></code> | The user's verification status. | 0.0.1 |
|
|
322
|
+
| **`ageLower`** | <code>number</code> | The (inclusive) lower bound of a supervised user's age range. Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`. | 0.0.1 |
|
|
323
|
+
| **`ageUpper`** | <code>number</code> | The (inclusive) upper bound of a supervised user's age range. Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED` and the user's age is under 18. | 0.0.1 |
|
|
324
|
+
| **`mostRecentApprovalDate`** | <code>string</code> | The effective from date of the most recent significant change that was approved. When an app is installed, the date of the most recent significant change prior to install is used. Only available when `userStatus` is `SUPERVISED_APPROVAL_PENDING` or `SUPERVISED_APPROVAL_DENIED`. Only available on Android. | 0.0.1 |
|
|
325
|
+
| **`installId`** | <code>string</code> | An ID assigned to supervised user installs by Google Play, used for the purposes of notifying you of revoked app approval. Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`. Only available on Android. | 0.0.1 |
|
|
326
|
+
| **`ageRangeDeclaration`** | <code><a href="#agerangedeclaration">AgeRangeDeclaration</a></code> | The age range declaration type. Only available on iOS (26.2+). | 0.4.0 |
|
|
311
327
|
|
|
312
328
|
|
|
313
329
|
#### CheckAgeSignalsOptions
|
|
@@ -360,8 +376,18 @@ Only available on Android.
|
|
|
360
376
|
| **`Supervised`** | <code>'SUPERVISED'</code> | The user has a supervised Google Account managed by a parent who sets their age. Use `ageLower` and `ageUpper` to determine the user's age range. | 0.0.1 |
|
|
361
377
|
| **`SupervisedApprovalPending`** | <code>'SUPERVISED_APPROVAL_PENDING'</code> | The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes. Use `ageLower` and `ageUpper` to determine the user's age range. Use `mostRecentApprovalDate` to determine the last significant change that was approved. | 0.0.1 |
|
|
362
378
|
| **`SupervisedApprovalDenied`** | <code>'SUPERVISED_APPROVAL_DENIED'</code> | The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes. Use `ageLower` and `ageUpper` to determine the user's age range. Use `mostRecentApprovalDate` to determine the last significant change that was approved. | 0.0.1 |
|
|
363
|
-
| **`Unknown`** | <code>'UNKNOWN'</code> | The user is
|
|
364
|
-
| **`
|
|
379
|
+
| **`Unknown`** | <code>'UNKNOWN'</code> | The user's age is unknown and the user is in an applicable jurisdiction or region. To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status. | 0.0.1 |
|
|
380
|
+
| **`Declared`** | <code>'DECLARED'</code> | The user has self-declared or guardian-declared their age. Only available on Android. | 0.4.0 |
|
|
381
|
+
| **`Empty`** | <code>'EMPTY'</code> | The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps. | 0.0.1 |
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
#### AgeRangeDeclaration
|
|
385
|
+
|
|
386
|
+
| Members | Value | Description | Since |
|
|
387
|
+
| ---------------------- | -------------------------------- | -------------------------------------------------------------------------------------- | ----- |
|
|
388
|
+
| **`SelfDeclared`** | <code>'SELF_DECLARED'</code> | The age range was self-declared by the user without external verification. | 0.4.0 |
|
|
389
|
+
| **`GuardianDeclared`** | <code>'GUARDIAN_DECLARED'</code> | The age range was declared by a guardian without external verification. | 0.4.0 |
|
|
390
|
+
| **`Confirmed`** | <code>'CONFIRMED'</code> | The age range was set using a scrutinized method, like a credit card or government ID. | 0.4.0 |
|
|
365
391
|
|
|
366
392
|
|
|
367
393
|
#### ErrorCode
|
|
@@ -378,6 +404,7 @@ Only available on Android.
|
|
|
378
404
|
| **`ClientTransientError`** | <code>'CLIENT_TRANSIENT_ERROR'</code> | There was a transient error in the client device. | 0.0.1 |
|
|
379
405
|
| **`AppNotOwned`** | <code>'APP_NOT_OWNED'</code> | The app was not installed by Google Play. | 0.0.1 |
|
|
380
406
|
| **`InternalError`** | <code>'INTERNAL_ERROR'</code> | Unknown internal error. | 0.0.1 |
|
|
407
|
+
| **`SdkVersionOutdated`** | <code>'SDK_VERSION_OUTDATED'</code> | The Age Signals SDK version is outdated. Only available on Android. | 0.4.0 |
|
|
381
408
|
|
|
382
409
|
</docgen-api>
|
|
383
410
|
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ ext {
|
|
|
3
3
|
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
4
|
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
5
5
|
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
6
|
-
androidPlayAgeSignalsVersion = project.hasProperty('androidPlayAgeSignalsVersion') ? rootProject.ext.androidPlayAgeSignalsVersion : '0.0.
|
|
6
|
+
androidPlayAgeSignalsVersion = project.hasProperty('androidPlayAgeSignalsVersion') ? rootProject.ext.androidPlayAgeSignalsVersion : '0.0.3'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
@@ -31,7 +31,7 @@ android {
|
|
|
31
31
|
buildTypes {
|
|
32
32
|
release {
|
|
33
33
|
minifyEnabled false
|
|
34
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
34
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
lintOptions {
|
|
@@ -33,6 +33,10 @@ public class CustomExceptions {
|
|
|
33
33
|
);
|
|
34
34
|
public static final CustomException APP_NOT_OWNED = new CustomException("APP_NOT_OWNED", "The app was not installed by Google Play.");
|
|
35
35
|
public static final CustomException INTERNAL_ERROR = new CustomException("INTERNAL_ERROR", "Unknown internal error.");
|
|
36
|
+
public static final CustomException SDK_VERSION_OUTDATED = new CustomException(
|
|
37
|
+
"SDK_VERSION_OUTDATED",
|
|
38
|
+
"The Age Signals SDK version is outdated."
|
|
39
|
+
);
|
|
36
40
|
public static final CustomException USER_STATUS_MISSING = new CustomException(null, "userStatus must be provided.");
|
|
37
41
|
public static final CustomException FAKE_MANAGER_NOT_ENABLED = new CustomException(null, "Fake manager is not enabled.");
|
|
38
42
|
}
|
|
@@ -46,6 +46,8 @@ public class SetNextAgeSignalsExceptionOptions {
|
|
|
46
46
|
return AgeSignalsErrorCode.APP_NOT_OWNED;
|
|
47
47
|
case "INTERNAL_ERROR":
|
|
48
48
|
return AgeSignalsErrorCode.INTERNAL_ERROR;
|
|
49
|
+
case "SDK_VERSION_OUTDATED":
|
|
50
|
+
return AgeSignalsErrorCode.SDK_VERSION_OUTDATED;
|
|
49
51
|
default:
|
|
50
52
|
throw new Exception("Invalid errorCode: " + errorCode);
|
|
51
53
|
}
|
|
@@ -75,7 +75,7 @@ public class SetNextAgeSignalsResultOptions {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
@
|
|
78
|
+
@Nullable
|
|
79
79
|
private Integer mapUserStatusToVerificationStatus(@NonNull UserStatus userStatus) {
|
|
80
80
|
switch (userStatus) {
|
|
81
81
|
case VERIFIED:
|
|
@@ -88,8 +88,11 @@ public class SetNextAgeSignalsResultOptions {
|
|
|
88
88
|
return AgeSignalsVerificationStatus.SUPERVISED_APPROVAL_DENIED;
|
|
89
89
|
case UNKNOWN:
|
|
90
90
|
return AgeSignalsVerificationStatus.UNKNOWN;
|
|
91
|
+
case DECLARED:
|
|
92
|
+
return AgeSignalsVerificationStatus.DECLARED;
|
|
93
|
+
case EMPTY:
|
|
91
94
|
default:
|
|
92
|
-
return
|
|
95
|
+
return null;
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
|
|
@@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
|
|
4
4
|
import androidx.annotation.Nullable;
|
|
5
5
|
import com.getcapacitor.JSObject;
|
|
6
6
|
import com.google.android.play.agesignals.AgeSignalsResult;
|
|
7
|
+
import com.google.android.play.agesignals.model.AgeSignalsVerificationStatus;
|
|
7
8
|
import io.capawesome.capacitorjs.plugins.agesignals.enums.UserStatus;
|
|
8
9
|
import io.capawesome.capacitorjs.plugins.agesignals.interfaces.Result;
|
|
9
10
|
|
|
@@ -59,12 +60,21 @@ public class CheckAgeSignalsResult implements Result {
|
|
|
59
60
|
return UserStatus.EMPTY;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
switch (status) {
|
|
64
|
+
case AgeSignalsVerificationStatus.VERIFIED:
|
|
65
|
+
return UserStatus.VERIFIED;
|
|
66
|
+
case AgeSignalsVerificationStatus.SUPERVISED:
|
|
67
|
+
return UserStatus.SUPERVISED;
|
|
68
|
+
case AgeSignalsVerificationStatus.SUPERVISED_APPROVAL_PENDING:
|
|
69
|
+
return UserStatus.SUPERVISED_APPROVAL_PENDING;
|
|
70
|
+
case AgeSignalsVerificationStatus.SUPERVISED_APPROVAL_DENIED:
|
|
71
|
+
return UserStatus.SUPERVISED_APPROVAL_DENIED;
|
|
72
|
+
case AgeSignalsVerificationStatus.UNKNOWN:
|
|
73
|
+
return UserStatus.UNKNOWN;
|
|
74
|
+
case AgeSignalsVerificationStatus.DECLARED:
|
|
75
|
+
return UserStatus.DECLARED;
|
|
76
|
+
default:
|
|
77
|
+
throw new IllegalArgumentException("Invalid UserStatus: " + status);
|
|
66
78
|
}
|
|
67
|
-
|
|
68
|
-
return values[status];
|
|
69
79
|
}
|
|
70
80
|
}
|
package/dist/docs.json
CHANGED
|
@@ -213,6 +213,20 @@
|
|
|
213
213
|
"docs": "An ID assigned to supervised user installs by Google Play, used for the purposes of notifying you of revoked app approval.\n\nOnly available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`.\n\nOnly available on Android.",
|
|
214
214
|
"complexTypes": [],
|
|
215
215
|
"type": "string | undefined"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "ageRangeDeclaration",
|
|
219
|
+
"tags": [
|
|
220
|
+
{
|
|
221
|
+
"text": "0.4.0",
|
|
222
|
+
"name": "since"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"docs": "The age range declaration type.\n\nOnly available on iOS (26.2+).",
|
|
226
|
+
"complexTypes": [
|
|
227
|
+
"AgeRangeDeclaration"
|
|
228
|
+
],
|
|
229
|
+
"type": "AgeRangeDeclaration"
|
|
216
230
|
}
|
|
217
231
|
]
|
|
218
232
|
},
|
|
@@ -489,7 +503,18 @@
|
|
|
489
503
|
"name": "since"
|
|
490
504
|
}
|
|
491
505
|
],
|
|
492
|
-
"docs": "The user is
|
|
506
|
+
"docs": "The user's age is unknown and the user is in an applicable jurisdiction or region.\nTo obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status."
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"name": "Declared",
|
|
510
|
+
"value": "'DECLARED'",
|
|
511
|
+
"tags": [
|
|
512
|
+
{
|
|
513
|
+
"text": "0.4.0",
|
|
514
|
+
"name": "since"
|
|
515
|
+
}
|
|
516
|
+
],
|
|
517
|
+
"docs": "The user has self-declared or guardian-declared their age.\n\nOnly available on Android."
|
|
493
518
|
},
|
|
494
519
|
{
|
|
495
520
|
"name": "Empty",
|
|
@@ -500,7 +525,46 @@
|
|
|
500
525
|
"name": "since"
|
|
501
526
|
}
|
|
502
527
|
],
|
|
503
|
-
"docs": "
|
|
528
|
+
"docs": "The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps."
|
|
529
|
+
}
|
|
530
|
+
]
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"name": "AgeRangeDeclaration",
|
|
534
|
+
"slug": "agerangedeclaration",
|
|
535
|
+
"members": [
|
|
536
|
+
{
|
|
537
|
+
"name": "SelfDeclared",
|
|
538
|
+
"value": "'SELF_DECLARED'",
|
|
539
|
+
"tags": [
|
|
540
|
+
{
|
|
541
|
+
"text": "0.4.0",
|
|
542
|
+
"name": "since"
|
|
543
|
+
}
|
|
544
|
+
],
|
|
545
|
+
"docs": "The age range was self-declared by the user without external verification."
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "GuardianDeclared",
|
|
549
|
+
"value": "'GUARDIAN_DECLARED'",
|
|
550
|
+
"tags": [
|
|
551
|
+
{
|
|
552
|
+
"text": "0.4.0",
|
|
553
|
+
"name": "since"
|
|
554
|
+
}
|
|
555
|
+
],
|
|
556
|
+
"docs": "The age range was declared by a guardian without external verification."
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"name": "Confirmed",
|
|
560
|
+
"value": "'CONFIRMED'",
|
|
561
|
+
"tags": [
|
|
562
|
+
{
|
|
563
|
+
"text": "0.4.0",
|
|
564
|
+
"name": "since"
|
|
565
|
+
}
|
|
566
|
+
],
|
|
567
|
+
"docs": "The age range was set using a scrutinized method, like a credit card or government ID."
|
|
504
568
|
}
|
|
505
569
|
]
|
|
506
570
|
},
|
|
@@ -617,6 +681,17 @@
|
|
|
617
681
|
}
|
|
618
682
|
],
|
|
619
683
|
"docs": "Unknown internal error."
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"name": "SdkVersionOutdated",
|
|
687
|
+
"value": "'SDK_VERSION_OUTDATED'",
|
|
688
|
+
"tags": [
|
|
689
|
+
{
|
|
690
|
+
"text": "0.4.0",
|
|
691
|
+
"name": "since"
|
|
692
|
+
}
|
|
693
|
+
],
|
|
694
|
+
"docs": "The Age Signals SDK version is outdated.\n\nOnly available on Android."
|
|
620
695
|
}
|
|
621
696
|
]
|
|
622
697
|
}
|
|
@@ -107,6 +107,14 @@ export interface CheckAgeSignalsResult {
|
|
|
107
107
|
* @example "abc123xyz"
|
|
108
108
|
*/
|
|
109
109
|
installId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The age range declaration type.
|
|
112
|
+
*
|
|
113
|
+
* Only available on iOS (26.2+).
|
|
114
|
+
*
|
|
115
|
+
* @since 0.4.0
|
|
116
|
+
*/
|
|
117
|
+
ageRangeDeclaration?: AgeRangeDeclaration;
|
|
110
118
|
}
|
|
111
119
|
/**
|
|
112
120
|
* @since 0.3.1
|
|
@@ -157,14 +165,22 @@ export declare enum UserStatus {
|
|
|
157
165
|
*/
|
|
158
166
|
SupervisedApprovalDenied = "SUPERVISED_APPROVAL_DENIED",
|
|
159
167
|
/**
|
|
160
|
-
* The user is
|
|
168
|
+
* The user's age is unknown and the user is in an applicable jurisdiction or region.
|
|
161
169
|
* To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.
|
|
162
170
|
*
|
|
163
171
|
* @since 0.0.1
|
|
164
172
|
*/
|
|
165
173
|
Unknown = "UNKNOWN",
|
|
166
174
|
/**
|
|
167
|
-
*
|
|
175
|
+
* The user has self-declared or guardian-declared their age.
|
|
176
|
+
*
|
|
177
|
+
* Only available on Android.
|
|
178
|
+
*
|
|
179
|
+
* @since 0.4.0
|
|
180
|
+
*/
|
|
181
|
+
Declared = "DECLARED",
|
|
182
|
+
/**
|
|
183
|
+
* The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps.
|
|
168
184
|
*
|
|
169
185
|
* @since 0.0.1
|
|
170
186
|
*/
|
|
@@ -233,7 +249,38 @@ export declare enum ErrorCode {
|
|
|
233
249
|
*
|
|
234
250
|
* @since 0.0.1
|
|
235
251
|
*/
|
|
236
|
-
InternalError = "INTERNAL_ERROR"
|
|
252
|
+
InternalError = "INTERNAL_ERROR",
|
|
253
|
+
/**
|
|
254
|
+
* The Age Signals SDK version is outdated.
|
|
255
|
+
*
|
|
256
|
+
* Only available on Android.
|
|
257
|
+
*
|
|
258
|
+
* @since 0.4.0
|
|
259
|
+
*/
|
|
260
|
+
SdkVersionOutdated = "SDK_VERSION_OUTDATED"
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* @since 0.4.0
|
|
264
|
+
*/
|
|
265
|
+
export declare enum AgeRangeDeclaration {
|
|
266
|
+
/**
|
|
267
|
+
* The age range was self-declared by the user without external verification.
|
|
268
|
+
*
|
|
269
|
+
* @since 0.4.0
|
|
270
|
+
*/
|
|
271
|
+
SelfDeclared = "SELF_DECLARED",
|
|
272
|
+
/**
|
|
273
|
+
* The age range was declared by a guardian without external verification.
|
|
274
|
+
*
|
|
275
|
+
* @since 0.4.0
|
|
276
|
+
*/
|
|
277
|
+
GuardianDeclared = "GUARDIAN_DECLARED",
|
|
278
|
+
/**
|
|
279
|
+
* The age range was set using a scrutinized method, like a credit card or government ID.
|
|
280
|
+
*
|
|
281
|
+
* @since 0.4.0
|
|
282
|
+
*/
|
|
283
|
+
Confirmed = "CONFIRMED"
|
|
237
284
|
}
|
|
238
285
|
/**
|
|
239
286
|
* @since 0.3.1
|
package/dist/esm/definitions.js
CHANGED
|
@@ -33,14 +33,22 @@ export var UserStatus;
|
|
|
33
33
|
*/
|
|
34
34
|
UserStatus["SupervisedApprovalDenied"] = "SUPERVISED_APPROVAL_DENIED";
|
|
35
35
|
/**
|
|
36
|
-
* The user is
|
|
36
|
+
* The user's age is unknown and the user is in an applicable jurisdiction or region.
|
|
37
37
|
* To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.
|
|
38
38
|
*
|
|
39
39
|
* @since 0.0.1
|
|
40
40
|
*/
|
|
41
41
|
UserStatus["Unknown"] = "UNKNOWN";
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* The user has self-declared or guardian-declared their age.
|
|
44
|
+
*
|
|
45
|
+
* Only available on Android.
|
|
46
|
+
*
|
|
47
|
+
* @since 0.4.0
|
|
48
|
+
*/
|
|
49
|
+
UserStatus["Declared"] = "DECLARED";
|
|
50
|
+
/**
|
|
51
|
+
* The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps.
|
|
44
52
|
*
|
|
45
53
|
* @since 0.0.1
|
|
46
54
|
*/
|
|
@@ -111,5 +119,37 @@ export var ErrorCode;
|
|
|
111
119
|
* @since 0.0.1
|
|
112
120
|
*/
|
|
113
121
|
ErrorCode["InternalError"] = "INTERNAL_ERROR";
|
|
122
|
+
/**
|
|
123
|
+
* The Age Signals SDK version is outdated.
|
|
124
|
+
*
|
|
125
|
+
* Only available on Android.
|
|
126
|
+
*
|
|
127
|
+
* @since 0.4.0
|
|
128
|
+
*/
|
|
129
|
+
ErrorCode["SdkVersionOutdated"] = "SDK_VERSION_OUTDATED";
|
|
114
130
|
})(ErrorCode || (ErrorCode = {}));
|
|
131
|
+
/**
|
|
132
|
+
* @since 0.4.0
|
|
133
|
+
*/
|
|
134
|
+
export var AgeRangeDeclaration;
|
|
135
|
+
(function (AgeRangeDeclaration) {
|
|
136
|
+
/**
|
|
137
|
+
* The age range was self-declared by the user without external verification.
|
|
138
|
+
*
|
|
139
|
+
* @since 0.4.0
|
|
140
|
+
*/
|
|
141
|
+
AgeRangeDeclaration["SelfDeclared"] = "SELF_DECLARED";
|
|
142
|
+
/**
|
|
143
|
+
* The age range was declared by a guardian without external verification.
|
|
144
|
+
*
|
|
145
|
+
* @since 0.4.0
|
|
146
|
+
*/
|
|
147
|
+
AgeRangeDeclaration["GuardianDeclared"] = "GUARDIAN_DECLARED";
|
|
148
|
+
/**
|
|
149
|
+
* The age range was set using a scrutinized method, like a credit card or government ID.
|
|
150
|
+
*
|
|
151
|
+
* @since 0.4.0
|
|
152
|
+
*/
|
|
153
|
+
AgeRangeDeclaration["Confirmed"] = "CONFIRMED";
|
|
154
|
+
})(AgeRangeDeclaration || (AgeRangeDeclaration = {}));
|
|
115
155
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAuIA;;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 * Enable or disable the fake age signals manager for testing.\n *\n * Only available on Android.\n *\n * @since 0.3.1\n */\n setUseFakeManager(options: SetUseFakeManagerOptions): Promise<void>;\n /**\n * Set the next age signals result to be returned by the fake manager.\n *\n * Only available on Android.\n *\n * @since 0.3.1\n */\n setNextAgeSignalsResult(\n options: SetNextAgeSignalsResultOptions,\n ): Promise<void>;\n /**\n * Set the next exception to be thrown by the fake manager.\n *\n * Only available on Android.\n *\n * @since 0.3.1\n */\n setNextAgeSignalsException(\n options: SetNextAgeSignalsExceptionOptions,\n ): Promise<void>;\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\n/**\n * @since 0.3.1\n */\nexport interface SetUseFakeManagerOptions {\n /**\n * Whether to use the fake age signals manager for testing.\n *\n * @since 0.3.1\n * @default false\n * @example true\n */\n useFake: boolean;\n}\n\n/**\n * @since 0.3.1\n */\nexport interface SetNextAgeSignalsResultOptions {\n /**\n * The user's verification status.\n *\n * @since 0.3.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.3.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.3.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 * @since 0.3.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 * @since 0.3.1\n * @example \"fake_install_id\"\n */\n installId?: string;\n}\n\n/**\n * @since 0.3.1\n */\nexport interface SetNextAgeSignalsExceptionOptions {\n /**\n * The error code to be thrown by the fake manager.\n *\n * @since 0.3.1\n */\n errorCode: ErrorCode;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA+IA;;GAEG;AACH,MAAM,CAAN,IAAY,UAmDX;AAnDD,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;;;;;;OAMG;IACH,mCAAqB,CAAA;IACrB;;;;OAIG;IACH,6BAAe,CAAA;AACjB,CAAC,EAnDW,UAAU,KAAV,UAAU,QAmDrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SAqEX;AArED,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;IAChC;;;;;;OAMG;IACH,wDAA2C,CAAA;AAC7C,CAAC,EArEW,SAAS,KAAT,SAAS,QAqEpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAmBX;AAnBD,WAAY,mBAAmB;IAC7B;;;;OAIG;IACH,qDAA8B,CAAA;IAC9B;;;;OAIG;IACH,6DAAsC,CAAA;IACtC;;;;OAIG;IACH,8CAAuB,CAAA;AACzB,CAAC,EAnBW,mBAAmB,KAAnB,mBAAmB,QAmB9B","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 * Enable or disable the fake age signals manager for testing.\n *\n * Only available on Android.\n *\n * @since 0.3.1\n */\n setUseFakeManager(options: SetUseFakeManagerOptions): Promise<void>;\n /**\n * Set the next age signals result to be returned by the fake manager.\n *\n * Only available on Android.\n *\n * @since 0.3.1\n */\n setNextAgeSignalsResult(\n options: SetNextAgeSignalsResultOptions,\n ): Promise<void>;\n /**\n * Set the next exception to be thrown by the fake manager.\n *\n * Only available on Android.\n *\n * @since 0.3.1\n */\n setNextAgeSignalsException(\n options: SetNextAgeSignalsExceptionOptions,\n ): Promise<void>;\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 * The age range declaration type.\n *\n * Only available on iOS (26.2+).\n *\n * @since 0.4.0\n */\n ageRangeDeclaration?: AgeRangeDeclaration;\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's age is unknown and the user is in an applicable jurisdiction or region.\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 * The user has self-declared or guardian-declared their age.\n *\n * Only available on Android.\n *\n * @since 0.4.0\n */\n Declared = 'DECLARED',\n /**\n * The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps.\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 * The Age Signals SDK version is outdated.\n *\n * Only available on Android.\n *\n * @since 0.4.0\n */\n SdkVersionOutdated = 'SDK_VERSION_OUTDATED',\n}\n\n/**\n * @since 0.4.0\n */\nexport enum AgeRangeDeclaration {\n /**\n * The age range was self-declared by the user without external verification.\n *\n * @since 0.4.0\n */\n SelfDeclared = 'SELF_DECLARED',\n /**\n * The age range was declared by a guardian without external verification.\n *\n * @since 0.4.0\n */\n GuardianDeclared = 'GUARDIAN_DECLARED',\n /**\n * The age range was set using a scrutinized method, like a credit card or government ID.\n *\n * @since 0.4.0\n */\n Confirmed = 'CONFIRMED',\n}\n\n/**\n * @since 0.3.1\n */\nexport interface SetUseFakeManagerOptions {\n /**\n * Whether to use the fake age signals manager for testing.\n *\n * @since 0.3.1\n * @default false\n * @example true\n */\n useFake: boolean;\n}\n\n/**\n * @since 0.3.1\n */\nexport interface SetNextAgeSignalsResultOptions {\n /**\n * The user's verification status.\n *\n * @since 0.3.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.3.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.3.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 * @since 0.3.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 * @since 0.3.1\n * @example \"fake_install_id\"\n */\n installId?: string;\n}\n\n/**\n * @since 0.3.1\n */\nexport interface SetNextAgeSignalsExceptionOptions {\n /**\n * The error code to be thrown by the fake manager.\n *\n * @since 0.3.1\n */\n errorCode: ErrorCode;\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -37,14 +37,22 @@ exports.UserStatus = void 0;
|
|
|
37
37
|
*/
|
|
38
38
|
UserStatus["SupervisedApprovalDenied"] = "SUPERVISED_APPROVAL_DENIED";
|
|
39
39
|
/**
|
|
40
|
-
* The user is
|
|
40
|
+
* The user's age is unknown and the user is in an applicable jurisdiction or region.
|
|
41
41
|
* To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.
|
|
42
42
|
*
|
|
43
43
|
* @since 0.0.1
|
|
44
44
|
*/
|
|
45
45
|
UserStatus["Unknown"] = "UNKNOWN";
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* The user has self-declared or guardian-declared their age.
|
|
48
|
+
*
|
|
49
|
+
* Only available on Android.
|
|
50
|
+
*
|
|
51
|
+
* @since 0.4.0
|
|
52
|
+
*/
|
|
53
|
+
UserStatus["Declared"] = "DECLARED";
|
|
54
|
+
/**
|
|
55
|
+
* The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps.
|
|
48
56
|
*
|
|
49
57
|
* @since 0.0.1
|
|
50
58
|
*/
|
|
@@ -115,7 +123,39 @@ exports.ErrorCode = void 0;
|
|
|
115
123
|
* @since 0.0.1
|
|
116
124
|
*/
|
|
117
125
|
ErrorCode["InternalError"] = "INTERNAL_ERROR";
|
|
126
|
+
/**
|
|
127
|
+
* The Age Signals SDK version is outdated.
|
|
128
|
+
*
|
|
129
|
+
* Only available on Android.
|
|
130
|
+
*
|
|
131
|
+
* @since 0.4.0
|
|
132
|
+
*/
|
|
133
|
+
ErrorCode["SdkVersionOutdated"] = "SDK_VERSION_OUTDATED";
|
|
118
134
|
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
135
|
+
/**
|
|
136
|
+
* @since 0.4.0
|
|
137
|
+
*/
|
|
138
|
+
exports.AgeRangeDeclaration = void 0;
|
|
139
|
+
(function (AgeRangeDeclaration) {
|
|
140
|
+
/**
|
|
141
|
+
* The age range was self-declared by the user without external verification.
|
|
142
|
+
*
|
|
143
|
+
* @since 0.4.0
|
|
144
|
+
*/
|
|
145
|
+
AgeRangeDeclaration["SelfDeclared"] = "SELF_DECLARED";
|
|
146
|
+
/**
|
|
147
|
+
* The age range was declared by a guardian without external verification.
|
|
148
|
+
*
|
|
149
|
+
* @since 0.4.0
|
|
150
|
+
*/
|
|
151
|
+
AgeRangeDeclaration["GuardianDeclared"] = "GUARDIAN_DECLARED";
|
|
152
|
+
/**
|
|
153
|
+
* The age range was set using a scrutinized method, like a credit card or government ID.
|
|
154
|
+
*
|
|
155
|
+
* @since 0.4.0
|
|
156
|
+
*/
|
|
157
|
+
AgeRangeDeclaration["Confirmed"] = "CONFIRMED";
|
|
158
|
+
})(exports.AgeRangeDeclaration || (exports.AgeRangeDeclaration = {}));
|
|
119
159
|
|
|
120
160
|
const AgeSignals = core.registerPlugin('AgeSignals', {
|
|
121
161
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AgeSignalsWeb()),
|
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
|
|
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's age is unknown and the user is in an applicable jurisdiction or region.\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 * The user has self-declared or guardian-declared their age.\n *\n * Only available on Android.\n *\n * @since 0.4.0\n */\n UserStatus[\"Declared\"] = \"DECLARED\";\n /**\n * The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps.\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 /**\n * The Age Signals SDK version is outdated.\n *\n * Only available on Android.\n *\n * @since 0.4.0\n */\n ErrorCode[\"SdkVersionOutdated\"] = \"SDK_VERSION_OUTDATED\";\n})(ErrorCode || (ErrorCode = {}));\n/**\n * @since 0.4.0\n */\nexport var AgeRangeDeclaration;\n(function (AgeRangeDeclaration) {\n /**\n * The age range was self-declared by the user without external verification.\n *\n * @since 0.4.0\n */\n AgeRangeDeclaration[\"SelfDeclared\"] = \"SELF_DECLARED\";\n /**\n * The age range was declared by a guardian without external verification.\n *\n * @since 0.4.0\n */\n AgeRangeDeclaration[\"GuardianDeclared\"] = \"GUARDIAN_DECLARED\";\n /**\n * The age range was set using a scrutinized method, like a credit card or government ID.\n *\n * @since 0.4.0\n */\n AgeRangeDeclaration[\"Confirmed\"] = \"CONFIRMED\";\n})(AgeRangeDeclaration || (AgeRangeDeclaration = {}));\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 async setUseFakeManager(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setNextAgeSignalsResult(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setNextAgeSignalsException(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["UserStatus","ErrorCode","AgeRangeDeclaration","registerPlugin","WebPlugin"],"mappings":"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"}
|
package/dist/plugin.js
CHANGED
|
@@ -36,14 +36,22 @@ var capacitorAgeSignals = (function (exports, core) {
|
|
|
36
36
|
*/
|
|
37
37
|
UserStatus["SupervisedApprovalDenied"] = "SUPERVISED_APPROVAL_DENIED";
|
|
38
38
|
/**
|
|
39
|
-
* The user is
|
|
39
|
+
* The user's age is unknown and the user is in an applicable jurisdiction or region.
|
|
40
40
|
* To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.
|
|
41
41
|
*
|
|
42
42
|
* @since 0.0.1
|
|
43
43
|
*/
|
|
44
44
|
UserStatus["Unknown"] = "UNKNOWN";
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* The user has self-declared or guardian-declared their age.
|
|
47
|
+
*
|
|
48
|
+
* Only available on Android.
|
|
49
|
+
*
|
|
50
|
+
* @since 0.4.0
|
|
51
|
+
*/
|
|
52
|
+
UserStatus["Declared"] = "DECLARED";
|
|
53
|
+
/**
|
|
54
|
+
* The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps.
|
|
47
55
|
*
|
|
48
56
|
* @since 0.0.1
|
|
49
57
|
*/
|
|
@@ -114,7 +122,39 @@ var capacitorAgeSignals = (function (exports, core) {
|
|
|
114
122
|
* @since 0.0.1
|
|
115
123
|
*/
|
|
116
124
|
ErrorCode["InternalError"] = "INTERNAL_ERROR";
|
|
125
|
+
/**
|
|
126
|
+
* The Age Signals SDK version is outdated.
|
|
127
|
+
*
|
|
128
|
+
* Only available on Android.
|
|
129
|
+
*
|
|
130
|
+
* @since 0.4.0
|
|
131
|
+
*/
|
|
132
|
+
ErrorCode["SdkVersionOutdated"] = "SDK_VERSION_OUTDATED";
|
|
117
133
|
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
134
|
+
/**
|
|
135
|
+
* @since 0.4.0
|
|
136
|
+
*/
|
|
137
|
+
exports.AgeRangeDeclaration = void 0;
|
|
138
|
+
(function (AgeRangeDeclaration) {
|
|
139
|
+
/**
|
|
140
|
+
* The age range was self-declared by the user without external verification.
|
|
141
|
+
*
|
|
142
|
+
* @since 0.4.0
|
|
143
|
+
*/
|
|
144
|
+
AgeRangeDeclaration["SelfDeclared"] = "SELF_DECLARED";
|
|
145
|
+
/**
|
|
146
|
+
* The age range was declared by a guardian without external verification.
|
|
147
|
+
*
|
|
148
|
+
* @since 0.4.0
|
|
149
|
+
*/
|
|
150
|
+
AgeRangeDeclaration["GuardianDeclared"] = "GUARDIAN_DECLARED";
|
|
151
|
+
/**
|
|
152
|
+
* The age range was set using a scrutinized method, like a credit card or government ID.
|
|
153
|
+
*
|
|
154
|
+
* @since 0.4.0
|
|
155
|
+
*/
|
|
156
|
+
AgeRangeDeclaration["Confirmed"] = "CONFIRMED";
|
|
157
|
+
})(exports.AgeRangeDeclaration || (exports.AgeRangeDeclaration = {}));
|
|
118
158
|
|
|
119
159
|
const AgeSignals = core.registerPlugin('AgeSignals', {
|
|
120
160
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AgeSignalsWeb()),
|
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
|
|
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's age is unknown and the user is in an applicable jurisdiction or region.\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 * The user has self-declared or guardian-declared their age.\n *\n * Only available on Android.\n *\n * @since 0.4.0\n */\n UserStatus[\"Declared\"] = \"DECLARED\";\n /**\n * The user is either not in an applicable jurisdiction or region, or the user does not share their age with apps.\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 /**\n * The Age Signals SDK version is outdated.\n *\n * Only available on Android.\n *\n * @since 0.4.0\n */\n ErrorCode[\"SdkVersionOutdated\"] = \"SDK_VERSION_OUTDATED\";\n})(ErrorCode || (ErrorCode = {}));\n/**\n * @since 0.4.0\n */\nexport var AgeRangeDeclaration;\n(function (AgeRangeDeclaration) {\n /**\n * The age range was self-declared by the user without external verification.\n *\n * @since 0.4.0\n */\n AgeRangeDeclaration[\"SelfDeclared\"] = \"SELF_DECLARED\";\n /**\n * The age range was declared by a guardian without external verification.\n *\n * @since 0.4.0\n */\n AgeRangeDeclaration[\"GuardianDeclared\"] = \"GUARDIAN_DECLARED\";\n /**\n * The age range was set using a scrutinized method, like a credit card or government ID.\n *\n * @since 0.4.0\n */\n AgeRangeDeclaration[\"Confirmed\"] = \"CONFIRMED\";\n})(AgeRangeDeclaration || (AgeRangeDeclaration = {}));\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 async setUseFakeManager(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setNextAgeSignalsResult(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async setNextAgeSignalsException(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["UserStatus","ErrorCode","AgeRangeDeclaration","registerPlugin","WebPlugin"],"mappings":"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"}
|
|
@@ -101,12 +101,35 @@ import DeclaredAgeRange
|
|
|
101
101
|
status = .unknown
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
let declaration: AgeRangeDeclaration?
|
|
105
|
+
if #available(iOS 26.2, *), let value = range.ageRangeDeclaration {
|
|
106
|
+
if #available(iOS 26.5, *), value == .confirmed {
|
|
107
|
+
declaration = .confirmed
|
|
108
|
+
} else {
|
|
109
|
+
switch value {
|
|
110
|
+
case .selfDeclared:
|
|
111
|
+
declaration = .selfDeclared
|
|
112
|
+
case .guardianDeclared:
|
|
113
|
+
declaration = .guardianDeclared
|
|
114
|
+
case .checkedByOtherMethod, .guardianCheckedByOtherMethod,
|
|
115
|
+
.governmentIDChecked, .guardianGovernmentIDChecked,
|
|
116
|
+
.paymentChecked, .guardianPaymentChecked:
|
|
117
|
+
declaration = .confirmed
|
|
118
|
+
default:
|
|
119
|
+
declaration = nil
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
declaration = nil
|
|
124
|
+
}
|
|
125
|
+
|
|
104
126
|
return CheckAgeSignalsResult(
|
|
105
127
|
userStatus: status,
|
|
106
128
|
ageLower: lower,
|
|
107
129
|
ageUpper: upper,
|
|
108
130
|
mostRecentApprovalDate: nil,
|
|
109
|
-
installId: nil
|
|
131
|
+
installId: nil,
|
|
132
|
+
ageRangeDeclaration: declaration
|
|
110
133
|
)
|
|
111
134
|
|
|
112
135
|
@unknown default:
|
|
@@ -6,19 +6,22 @@ import Capacitor
|
|
|
6
6
|
let ageUpper: Int?
|
|
7
7
|
let mostRecentApprovalDate: String?
|
|
8
8
|
let installId: String?
|
|
9
|
+
let ageRangeDeclaration: AgeRangeDeclaration?
|
|
9
10
|
|
|
10
11
|
init(
|
|
11
12
|
userStatus: UserStatus,
|
|
12
13
|
ageLower: Int? = nil,
|
|
13
14
|
ageUpper: Int? = nil,
|
|
14
15
|
mostRecentApprovalDate: String? = nil,
|
|
15
|
-
installId: String? = nil
|
|
16
|
+
installId: String? = nil,
|
|
17
|
+
ageRangeDeclaration: AgeRangeDeclaration? = nil
|
|
16
18
|
) {
|
|
17
19
|
self.userStatus = userStatus
|
|
18
20
|
self.ageLower = ageLower
|
|
19
21
|
self.ageUpper = ageUpper
|
|
20
22
|
self.mostRecentApprovalDate = mostRecentApprovalDate
|
|
21
23
|
self.installId = installId
|
|
24
|
+
self.ageRangeDeclaration = ageRangeDeclaration
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
func toJSObject() -> AnyObject {
|
|
@@ -28,6 +31,7 @@ import Capacitor
|
|
|
28
31
|
result["ageUpper"] = ageUpper
|
|
29
32
|
result["mostRecentApprovalDate"] = mostRecentApprovalDate
|
|
30
33
|
result["installId"] = installId
|
|
34
|
+
result["ageRangeDeclaration"] = ageRangeDeclaration?.rawValue
|
|
31
35
|
return result as AnyObject
|
|
32
36
|
}
|
|
33
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/capacitor-age-signals",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"@capacitor/docgen": "0.3.1",
|
|
65
65
|
"@capacitor/ios": "8.0.0",
|
|
66
66
|
"@ionic/eslint-config": "0.4.0",
|
|
67
|
-
"@ionic/swiftlint-config": "2.0.0",
|
|
68
67
|
"eslint": "8.57.0",
|
|
69
68
|
"prettier": "3.4.2",
|
|
70
69
|
"prettier-plugin-java": "2.6.7",
|
|
@@ -76,7 +75,6 @@
|
|
|
76
75
|
"peerDependencies": {
|
|
77
76
|
"@capacitor/core": ">=8.0.0"
|
|
78
77
|
},
|
|
79
|
-
"swiftlint": "@ionic/swiftlint-config",
|
|
80
78
|
"eslintConfig": {
|
|
81
79
|
"extends": "@ionic/eslint-config/recommended"
|
|
82
80
|
},
|