@capawesome/capacitor-age-signals 0.3.1 โ 0.3.2
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 +216 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignals.java +58 -1
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignalsPlugin.java +77 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/CustomExceptions.java +2 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/options/SetNextAgeSignalsExceptionOptions.java +53 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/options/SetNextAgeSignalsResultOptions.java +109 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/options/SetUseFakeManagerOptions.java +16 -0
- package/dist/docs.json +339 -0
- package/dist/esm/definitions.d.ts +96 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +4 -1
- package/dist/esm/web.js +9 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +9 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +9 -0
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,20 @@ 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
|
+
## Features
|
|
16
|
+
|
|
17
|
+
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:
|
|
18
|
+
|
|
19
|
+
- ๐ฅ๏ธ **Cross-platform**: Supports Android and iOS.
|
|
20
|
+
- ๐ **Age Verification**: Request user age signals using Play Age Signals API (Android) and DeclaredAgeRange (iOS).
|
|
21
|
+
- ๐จโ๐ฉโ๐งโ๐ฆ **Parental Controls**: Support for supervised accounts with parental approval status.
|
|
22
|
+
- ๐งช **Testing Support**: Built-in `FakeAgeSignalsManager` integration for testing different age verification scenarios (Android).
|
|
23
|
+
- ๐ **Compliance Ready**: Built for US state age verification requirements (effective January 1, 2026).
|
|
24
|
+
- ๐ฆ **SPM**: Supports Swift Package Manager for iOS.
|
|
25
|
+
- ๐ **Up-to-date**: Always supports the latest Capacitor version.
|
|
26
|
+
|
|
27
|
+
Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!
|
|
28
|
+
|
|
15
29
|
## Compatibility
|
|
16
30
|
|
|
17
31
|
| Plugin Version | Capacitor Version | Status |
|
|
@@ -36,6 +50,8 @@ If needed, you can define the following project variable in your app's `variable
|
|
|
36
50
|
|
|
37
51
|
This can be useful if you encounter dependency conflicts with other plugins in your project.
|
|
38
52
|
|
|
53
|
+
**Note**: The `FakeAgeSignalsManager` testing API is included in the main `age-signals` library, so no additional dependency is required for testing.
|
|
54
|
+
|
|
39
55
|
### iOS
|
|
40
56
|
|
|
41
57
|
#### Entitlements
|
|
@@ -71,12 +87,114 @@ const checkEligibility = async () => {
|
|
|
71
87
|
};
|
|
72
88
|
```
|
|
73
89
|
|
|
90
|
+
## Testing
|
|
91
|
+
|
|
92
|
+
The plugin includes support for the `FakeAgeSignalsManager` API on Android, which allows you to simulate different age signals scenarios in your tests without requiring live responses from Google Play.
|
|
93
|
+
|
|
94
|
+
### Android Testing
|
|
95
|
+
|
|
96
|
+
**Important**: Due to a known issue in versions 0.0.1 and 0.0.2 of the Age Signals API, you may encounter a `java.lang.VerifyError` when calling the builder method of `AgeSignalsResult` in unit tests. As a workaround, run your tests as Android instrumented tests within the `androidTest` source set.
|
|
97
|
+
|
|
98
|
+
#### Example: Testing a Verified Adult User
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { AgeSignals, UserStatus } from '@capawesome/capacitor-age-signals';
|
|
102
|
+
|
|
103
|
+
// Enable the fake manager
|
|
104
|
+
await AgeSignals.setUseFakeManager({ useFake: true });
|
|
105
|
+
|
|
106
|
+
// Set up a verified adult user
|
|
107
|
+
await AgeSignals.setNextAgeSignalsResult({
|
|
108
|
+
userStatus: UserStatus.Verified,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Check age signals - will return the fake result
|
|
112
|
+
const result = await AgeSignals.checkAgeSignals();
|
|
113
|
+
console.log(result.userStatus); // 'VERIFIED'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### Example: Testing a Supervised User (13-17 years old)
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { AgeSignals, UserStatus } from '@capawesome/capacitor-age-signals';
|
|
120
|
+
|
|
121
|
+
await AgeSignals.setUseFakeManager({ useFake: true });
|
|
122
|
+
|
|
123
|
+
await AgeSignals.setNextAgeSignalsResult({
|
|
124
|
+
userStatus: UserStatus.Supervised,
|
|
125
|
+
ageLower: 13,
|
|
126
|
+
ageUpper: 17,
|
|
127
|
+
installId: 'fake_install_id',
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const result = await AgeSignals.checkAgeSignals();
|
|
131
|
+
console.log(result.userStatus); // 'SUPERVISED'
|
|
132
|
+
console.log(result.ageLower); // 13
|
|
133
|
+
console.log(result.ageUpper); // 17
|
|
134
|
+
console.log(result.installId); // 'fake_install_id'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Example: Testing Parental Approval Scenarios
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { AgeSignals, UserStatus } from '@capawesome/capacitor-age-signals';
|
|
141
|
+
|
|
142
|
+
await AgeSignals.setUseFakeManager({ useFake: true });
|
|
143
|
+
|
|
144
|
+
// Test pending approval
|
|
145
|
+
await AgeSignals.setNextAgeSignalsResult({
|
|
146
|
+
userStatus: UserStatus.SupervisedApprovalPending,
|
|
147
|
+
ageLower: 13,
|
|
148
|
+
ageUpper: 17,
|
|
149
|
+
mostRecentApprovalDate: '2025-02-01',
|
|
150
|
+
installId: 'fake_install_id',
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const result = await AgeSignals.checkAgeSignals();
|
|
154
|
+
console.log(result.userStatus); // 'SUPERVISED_APPROVAL_PENDING'
|
|
155
|
+
console.log(result.mostRecentApprovalDate); // '2025-02-01'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### Example: Testing Error Scenarios
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
import { AgeSignals, ErrorCode } from '@capawesome/capacitor-age-signals';
|
|
162
|
+
|
|
163
|
+
await AgeSignals.setUseFakeManager({ useFake: true });
|
|
164
|
+
|
|
165
|
+
// Simulate a network error
|
|
166
|
+
await AgeSignals.setNextAgeSignalsException({
|
|
167
|
+
errorCode: ErrorCode.NetworkError,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
try {
|
|
171
|
+
await AgeSignals.checkAgeSignals();
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.log('Caught network error:', error);
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### Disabling the Fake Manager
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { AgeSignals } from '@capawesome/capacitor-age-signals';
|
|
181
|
+
|
|
182
|
+
// Switch back to the production manager
|
|
183
|
+
await AgeSignals.setUseFakeManager({ useFake: false });
|
|
184
|
+
|
|
185
|
+
// This will now use the real Age Signals API
|
|
186
|
+
const result = await AgeSignals.checkAgeSignals();
|
|
187
|
+
```
|
|
188
|
+
|
|
74
189
|
## API
|
|
75
190
|
|
|
76
191
|
<docgen-index>
|
|
77
192
|
|
|
78
193
|
* [`checkAgeSignals(...)`](#checkagesignals)
|
|
79
194
|
* [`checkEligibility()`](#checkeligibility)
|
|
195
|
+
* [`setUseFakeManager(...)`](#setusefakemanager)
|
|
196
|
+
* [`setNextAgeSignalsResult(...)`](#setnextagesignalsresult)
|
|
197
|
+
* [`setNextAgeSignalsException(...)`](#setnextagesignalsexception)
|
|
80
198
|
* [Interfaces](#interfaces)
|
|
81
199
|
* [Enums](#enums)
|
|
82
200
|
|
|
@@ -121,6 +239,63 @@ Only available on iOS.
|
|
|
121
239
|
--------------------
|
|
122
240
|
|
|
123
241
|
|
|
242
|
+
### setUseFakeManager(...)
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
setUseFakeManager(options: SetUseFakeManagerOptions) => Promise<void>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Enable or disable the fake age signals manager for testing.
|
|
249
|
+
|
|
250
|
+
Only available on Android.
|
|
251
|
+
|
|
252
|
+
| Param | Type |
|
|
253
|
+
| ------------- | ----------------------------------------------------------------------------- |
|
|
254
|
+
| **`options`** | <code><a href="#setusefakemanageroptions">SetUseFakeManagerOptions</a></code> |
|
|
255
|
+
|
|
256
|
+
**Since:** 0.3.1
|
|
257
|
+
|
|
258
|
+
--------------------
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
### setNextAgeSignalsResult(...)
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
setNextAgeSignalsResult(options: SetNextAgeSignalsResultOptions) => Promise<void>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Set the next age signals result to be returned by the fake manager.
|
|
268
|
+
|
|
269
|
+
Only available on Android.
|
|
270
|
+
|
|
271
|
+
| Param | Type |
|
|
272
|
+
| ------------- | ----------------------------------------------------------------------------------------- |
|
|
273
|
+
| **`options`** | <code><a href="#setnextagesignalsresultoptions">SetNextAgeSignalsResultOptions</a></code> |
|
|
274
|
+
|
|
275
|
+
**Since:** 0.3.1
|
|
276
|
+
|
|
277
|
+
--------------------
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
### setNextAgeSignalsException(...)
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
setNextAgeSignalsException(options: SetNextAgeSignalsExceptionOptions) => Promise<void>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Set the next exception to be thrown by the fake manager.
|
|
287
|
+
|
|
288
|
+
Only available on Android.
|
|
289
|
+
|
|
290
|
+
| Param | Type |
|
|
291
|
+
| ------------- | ----------------------------------------------------------------------------------------------- |
|
|
292
|
+
| **`options`** | <code><a href="#setnextagesignalsexceptionoptions">SetNextAgeSignalsExceptionOptions</a></code> |
|
|
293
|
+
|
|
294
|
+
**Since:** 0.3.1
|
|
295
|
+
|
|
296
|
+
--------------------
|
|
297
|
+
|
|
298
|
+
|
|
124
299
|
### Interfaces
|
|
125
300
|
|
|
126
301
|
|
|
@@ -149,6 +324,31 @@ Only available on iOS.
|
|
|
149
324
|
| **`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
325
|
|
|
151
326
|
|
|
327
|
+
#### SetUseFakeManagerOptions
|
|
328
|
+
|
|
329
|
+
| Prop | Type | Description | Default | Since |
|
|
330
|
+
| ------------- | -------------------- | -------------------------------------------------------- | ------------------ | ----- |
|
|
331
|
+
| **`useFake`** | <code>boolean</code> | Whether to use the fake age signals manager for testing. | <code>false</code> | 0.3.1 |
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
#### SetNextAgeSignalsResultOptions
|
|
335
|
+
|
|
336
|
+
| Prop | Type | Description | Since |
|
|
337
|
+
| ---------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
338
|
+
| **`userStatus`** | <code><a href="#userstatus">UserStatus</a></code> | The user's verification status. | 0.3.1 |
|
|
339
|
+
| **`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.3.1 |
|
|
340
|
+
| **`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.3.1 |
|
|
341
|
+
| **`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`. | 0.3.1 |
|
|
342
|
+
| **`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`. | 0.3.1 |
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
#### SetNextAgeSignalsExceptionOptions
|
|
346
|
+
|
|
347
|
+
| Prop | Type | Description | Since |
|
|
348
|
+
| --------------- | ----------------------------------------------- | ------------------------------------------------ | ----- |
|
|
349
|
+
| **`errorCode`** | <code><a href="#errorcode">ErrorCode</a></code> | The error code to be thrown by the fake manager. | 0.3.1 |
|
|
350
|
+
|
|
351
|
+
|
|
152
352
|
### Enums
|
|
153
353
|
|
|
154
354
|
|
|
@@ -163,6 +363,22 @@ Only available on iOS.
|
|
|
163
363
|
| **`Unknown`** | <code>'UNKNOWN'</code> | The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18. To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status. | 0.0.1 |
|
|
164
364
|
| **`Empty`** | <code>'EMPTY'</code> | All other users return this value. | 0.0.1 |
|
|
165
365
|
|
|
366
|
+
|
|
367
|
+
#### ErrorCode
|
|
368
|
+
|
|
369
|
+
| Members | Value | Description | Since |
|
|
370
|
+
| --------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
371
|
+
| **`ApiNotAvailable`** | <code>'API_NOT_AVAILABLE'</code> | The Play Age Signals API is not available. The Play Store app version installed on the device might be old. | 0.0.1 |
|
|
372
|
+
| **`PlayStoreNotFound`** | <code>'PLAY_STORE_NOT_FOUND'</code> | No Play Store app is found on the device. | 0.0.1 |
|
|
373
|
+
| **`NetworkError`** | <code>'NETWORK_ERROR'</code> | No available network is found. | 0.0.1 |
|
|
374
|
+
| **`PlayServicesNotFound`** | <code>'PLAY_SERVICES_NOT_FOUND'</code> | Play Services is not available or its version is too old. | 0.0.1 |
|
|
375
|
+
| **`CannotBindToService`** | <code>'CANNOT_BIND_TO_SERVICE'</code> | 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. | 0.0.1 |
|
|
376
|
+
| **`PlayStoreVersionOutdated`** | <code>'PLAY_STORE_VERSION_OUTDATED'</code> | The Play Store app needs to be updated. | 0.0.1 |
|
|
377
|
+
| **`PlayServicesVersionOutdated`** | <code>'PLAY_SERVICES_VERSION_OUTDATED'</code> | Play Services needs to be updated. | 0.0.1 |
|
|
378
|
+
| **`ClientTransientError`** | <code>'CLIENT_TRANSIENT_ERROR'</code> | There was a transient error in the client device. | 0.0.1 |
|
|
379
|
+
| **`AppNotOwned`** | <code>'APP_NOT_OWNED'</code> | The app was not installed by Google Play. | 0.0.1 |
|
|
380
|
+
| **`InternalError`** | <code>'INTERNAL_ERROR'</code> | Unknown internal error. | 0.0.1 |
|
|
381
|
+
|
|
166
382
|
</docgen-api>
|
|
167
383
|
|
|
168
384
|
## Changelog
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
package io.capawesome.capacitorjs.plugins.agesignals;
|
|
2
2
|
|
|
3
3
|
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
4
5
|
import com.google.android.gms.tasks.Task;
|
|
5
6
|
import com.google.android.play.agesignals.AgeSignalsManager;
|
|
6
7
|
import com.google.android.play.agesignals.AgeSignalsManagerFactory;
|
|
7
8
|
import com.google.android.play.agesignals.AgeSignalsRequest;
|
|
8
9
|
import com.google.android.play.agesignals.AgeSignalsResult;
|
|
10
|
+
import com.google.android.play.agesignals.testing.FakeAgeSignalsManager;
|
|
9
11
|
import io.capawesome.capacitorjs.plugins.agesignals.classes.CustomExceptions;
|
|
12
|
+
import io.capawesome.capacitorjs.plugins.agesignals.classes.options.SetNextAgeSignalsExceptionOptions;
|
|
13
|
+
import io.capawesome.capacitorjs.plugins.agesignals.classes.options.SetNextAgeSignalsResultOptions;
|
|
14
|
+
import io.capawesome.capacitorjs.plugins.agesignals.classes.options.SetUseFakeManagerOptions;
|
|
10
15
|
import io.capawesome.capacitorjs.plugins.agesignals.classes.results.CheckAgeSignalsResult;
|
|
16
|
+
import io.capawesome.capacitorjs.plugins.agesignals.interfaces.EmptyCallback;
|
|
11
17
|
import io.capawesome.capacitorjs.plugins.agesignals.interfaces.NonEmptyResultCallback;
|
|
12
18
|
|
|
13
19
|
public class AgeSignals {
|
|
@@ -15,12 +21,23 @@ public class AgeSignals {
|
|
|
15
21
|
@NonNull
|
|
16
22
|
private final AgeSignalsPlugin plugin;
|
|
17
23
|
|
|
24
|
+
private boolean useFakeManager = false;
|
|
25
|
+
|
|
26
|
+
@Nullable
|
|
27
|
+
private FakeAgeSignalsManager fakeManager = null;
|
|
28
|
+
|
|
18
29
|
public AgeSignals(@NonNull AgeSignalsPlugin plugin) {
|
|
19
30
|
this.plugin = plugin;
|
|
20
31
|
}
|
|
21
32
|
|
|
22
33
|
public void checkAgeSignals(@NonNull NonEmptyResultCallback<CheckAgeSignalsResult> callback) {
|
|
23
|
-
AgeSignalsManager manager
|
|
34
|
+
AgeSignalsManager manager;
|
|
35
|
+
if (useFakeManager && fakeManager != null) {
|
|
36
|
+
manager = fakeManager;
|
|
37
|
+
} else {
|
|
38
|
+
manager = AgeSignalsManagerFactory.create(plugin.getActivity());
|
|
39
|
+
}
|
|
40
|
+
|
|
24
41
|
AgeSignalsRequest request = AgeSignalsRequest.builder().build();
|
|
25
42
|
|
|
26
43
|
Task<AgeSignalsResult> task = manager.checkAgeSignals(request);
|
|
@@ -38,6 +55,46 @@ public class AgeSignals {
|
|
|
38
55
|
});
|
|
39
56
|
}
|
|
40
57
|
|
|
58
|
+
public void setUseFakeManager(@NonNull SetUseFakeManagerOptions options, @NonNull EmptyCallback callback) {
|
|
59
|
+
try {
|
|
60
|
+
this.useFakeManager = options.getUseFake();
|
|
61
|
+
if (this.useFakeManager) {
|
|
62
|
+
this.fakeManager = new FakeAgeSignalsManager();
|
|
63
|
+
} else {
|
|
64
|
+
this.fakeManager = null;
|
|
65
|
+
}
|
|
66
|
+
callback.success();
|
|
67
|
+
} catch (Exception exception) {
|
|
68
|
+
callback.error(exception);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public void setNextAgeSignalsResult(@NonNull SetNextAgeSignalsResultOptions options, @NonNull EmptyCallback callback) {
|
|
73
|
+
try {
|
|
74
|
+
if (!useFakeManager || fakeManager == null) {
|
|
75
|
+
throw CustomExceptions.FAKE_MANAGER_NOT_ENABLED;
|
|
76
|
+
}
|
|
77
|
+
com.google.android.play.agesignals.AgeSignalsResult result = options.buildAgeSignalsResult();
|
|
78
|
+
fakeManager.setNextAgeSignalsResult(result);
|
|
79
|
+
callback.success();
|
|
80
|
+
} catch (Exception exception) {
|
|
81
|
+
callback.error(exception);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void setNextAgeSignalsException(@NonNull SetNextAgeSignalsExceptionOptions options, @NonNull EmptyCallback callback) {
|
|
86
|
+
try {
|
|
87
|
+
if (!useFakeManager || fakeManager == null) {
|
|
88
|
+
throw CustomExceptions.FAKE_MANAGER_NOT_ENABLED;
|
|
89
|
+
}
|
|
90
|
+
com.google.android.play.agesignals.AgeSignalsException exception = options.buildAgeSignalsException();
|
|
91
|
+
fakeManager.setNextAgeSignalsException(exception);
|
|
92
|
+
callback.success();
|
|
93
|
+
} catch (Exception exception) {
|
|
94
|
+
callback.error(exception);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
41
98
|
@NonNull
|
|
42
99
|
private Exception mapErrorCodeToException(@NonNull Exception exception) {
|
|
43
100
|
if (!(exception instanceof com.google.android.gms.common.api.ApiException)) {
|
package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignalsPlugin.java
CHANGED
|
@@ -8,7 +8,11 @@ import com.getcapacitor.Plugin;
|
|
|
8
8
|
import com.getcapacitor.PluginCall;
|
|
9
9
|
import com.getcapacitor.PluginMethod;
|
|
10
10
|
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
11
|
+
import io.capawesome.capacitorjs.plugins.agesignals.classes.options.SetNextAgeSignalsExceptionOptions;
|
|
12
|
+
import io.capawesome.capacitorjs.plugins.agesignals.classes.options.SetNextAgeSignalsResultOptions;
|
|
13
|
+
import io.capawesome.capacitorjs.plugins.agesignals.classes.options.SetUseFakeManagerOptions;
|
|
11
14
|
import io.capawesome.capacitorjs.plugins.agesignals.classes.results.CheckAgeSignalsResult;
|
|
15
|
+
import io.capawesome.capacitorjs.plugins.agesignals.interfaces.EmptyCallback;
|
|
12
16
|
import io.capawesome.capacitorjs.plugins.agesignals.interfaces.NonEmptyResultCallback;
|
|
13
17
|
import io.capawesome.capacitorjs.plugins.agesignals.interfaces.Result;
|
|
14
18
|
|
|
@@ -55,6 +59,75 @@ public class AgeSignalsPlugin extends Plugin {
|
|
|
55
59
|
rejectCallAsUnimplemented(call);
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
@PluginMethod
|
|
63
|
+
public void setUseFakeManager(PluginCall call) {
|
|
64
|
+
try {
|
|
65
|
+
SetUseFakeManagerOptions options = new SetUseFakeManagerOptions(call);
|
|
66
|
+
EmptyCallback callback = new EmptyCallback() {
|
|
67
|
+
@Override
|
|
68
|
+
public void success() {
|
|
69
|
+
resolveCall(call);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@Override
|
|
73
|
+
public void error(@NonNull Exception exception) {
|
|
74
|
+
rejectCall(call, exception);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
assert implementation != null;
|
|
79
|
+
implementation.setUseFakeManager(options, callback);
|
|
80
|
+
} catch (Exception exception) {
|
|
81
|
+
rejectCall(call, exception);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@PluginMethod
|
|
86
|
+
public void setNextAgeSignalsResult(PluginCall call) {
|
|
87
|
+
try {
|
|
88
|
+
SetNextAgeSignalsResultOptions options = new SetNextAgeSignalsResultOptions(call);
|
|
89
|
+
EmptyCallback callback = new EmptyCallback() {
|
|
90
|
+
@Override
|
|
91
|
+
public void success() {
|
|
92
|
+
resolveCall(call);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@Override
|
|
96
|
+
public void error(@NonNull Exception exception) {
|
|
97
|
+
rejectCall(call, exception);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
assert implementation != null;
|
|
102
|
+
implementation.setNextAgeSignalsResult(options, callback);
|
|
103
|
+
} catch (Exception exception) {
|
|
104
|
+
rejectCall(call, exception);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@PluginMethod
|
|
109
|
+
public void setNextAgeSignalsException(PluginCall call) {
|
|
110
|
+
try {
|
|
111
|
+
SetNextAgeSignalsExceptionOptions options = new SetNextAgeSignalsExceptionOptions(call);
|
|
112
|
+
EmptyCallback callback = new EmptyCallback() {
|
|
113
|
+
@Override
|
|
114
|
+
public void success() {
|
|
115
|
+
resolveCall(call);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@Override
|
|
119
|
+
public void error(@NonNull Exception exception) {
|
|
120
|
+
rejectCall(call, exception);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
assert implementation != null;
|
|
125
|
+
implementation.setNextAgeSignalsException(options, callback);
|
|
126
|
+
} catch (Exception exception) {
|
|
127
|
+
rejectCall(call, exception);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
58
131
|
private void rejectCall(@NonNull PluginCall call, @NonNull Exception exception) {
|
|
59
132
|
String message = exception.getMessage();
|
|
60
133
|
if (message == null) {
|
|
@@ -68,6 +141,10 @@ public class AgeSignalsPlugin extends Plugin {
|
|
|
68
141
|
call.unimplemented("This method is not available on this platform.");
|
|
69
142
|
}
|
|
70
143
|
|
|
144
|
+
private void resolveCall(@NonNull PluginCall call) {
|
|
145
|
+
call.resolve();
|
|
146
|
+
}
|
|
147
|
+
|
|
71
148
|
private void resolveCall(@NonNull PluginCall call, @Nullable Result result) {
|
|
72
149
|
if (result == null) {
|
|
73
150
|
call.resolve();
|
|
@@ -33,4 +33,6 @@ 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 USER_STATUS_MISSING = new CustomException(null, "userStatus must be provided.");
|
|
37
|
+
public static final CustomException FAKE_MANAGER_NOT_ENABLED = new CustomException(null, "Fake manager is not enabled.");
|
|
36
38
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.agesignals.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.PluginCall;
|
|
5
|
+
import com.google.android.play.agesignals.AgeSignalsException;
|
|
6
|
+
import com.google.android.play.agesignals.model.AgeSignalsErrorCode;
|
|
7
|
+
|
|
8
|
+
public class SetNextAgeSignalsExceptionOptions {
|
|
9
|
+
|
|
10
|
+
@NonNull
|
|
11
|
+
private final String errorCode;
|
|
12
|
+
|
|
13
|
+
public SetNextAgeSignalsExceptionOptions(@NonNull PluginCall call) throws Exception {
|
|
14
|
+
String errorCode = call.getString("errorCode");
|
|
15
|
+
if (errorCode == null) {
|
|
16
|
+
throw new Exception("errorCode must be provided.");
|
|
17
|
+
}
|
|
18
|
+
this.errorCode = errorCode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@NonNull
|
|
22
|
+
public AgeSignalsException buildAgeSignalsException() throws Exception {
|
|
23
|
+
int errorCodeInt = mapErrorCodeToAgeSignalsErrorCode(this.errorCode);
|
|
24
|
+
return new AgeSignalsException(errorCodeInt);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private int mapErrorCodeToAgeSignalsErrorCode(@NonNull String errorCode) throws Exception {
|
|
28
|
+
switch (errorCode) {
|
|
29
|
+
case "API_NOT_AVAILABLE":
|
|
30
|
+
return AgeSignalsErrorCode.API_NOT_AVAILABLE;
|
|
31
|
+
case "PLAY_STORE_NOT_FOUND":
|
|
32
|
+
return AgeSignalsErrorCode.PLAY_STORE_NOT_FOUND;
|
|
33
|
+
case "NETWORK_ERROR":
|
|
34
|
+
return AgeSignalsErrorCode.NETWORK_ERROR;
|
|
35
|
+
case "PLAY_SERVICES_NOT_FOUND":
|
|
36
|
+
return AgeSignalsErrorCode.PLAY_SERVICES_NOT_FOUND;
|
|
37
|
+
case "CANNOT_BIND_TO_SERVICE":
|
|
38
|
+
return AgeSignalsErrorCode.CANNOT_BIND_TO_SERVICE;
|
|
39
|
+
case "PLAY_STORE_VERSION_OUTDATED":
|
|
40
|
+
return AgeSignalsErrorCode.PLAY_STORE_VERSION_OUTDATED;
|
|
41
|
+
case "PLAY_SERVICES_VERSION_OUTDATED":
|
|
42
|
+
return AgeSignalsErrorCode.PLAY_SERVICES_VERSION_OUTDATED;
|
|
43
|
+
case "CLIENT_TRANSIENT_ERROR":
|
|
44
|
+
return AgeSignalsErrorCode.CLIENT_TRANSIENT_ERROR;
|
|
45
|
+
case "APP_NOT_OWNED":
|
|
46
|
+
return AgeSignalsErrorCode.APP_NOT_OWNED;
|
|
47
|
+
case "INTERNAL_ERROR":
|
|
48
|
+
return AgeSignalsErrorCode.INTERNAL_ERROR;
|
|
49
|
+
default:
|
|
50
|
+
throw new Exception("Invalid errorCode: " + errorCode);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.agesignals.classes.options;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import com.google.android.play.agesignals.AgeSignalsResult;
|
|
7
|
+
import com.google.android.play.agesignals.model.AgeSignalsVerificationStatus;
|
|
8
|
+
import io.capawesome.capacitorjs.plugins.agesignals.classes.CustomExceptions;
|
|
9
|
+
import io.capawesome.capacitorjs.plugins.agesignals.enums.UserStatus;
|
|
10
|
+
import java.text.SimpleDateFormat;
|
|
11
|
+
import java.util.Date;
|
|
12
|
+
import java.util.Locale;
|
|
13
|
+
|
|
14
|
+
public class SetNextAgeSignalsResultOptions {
|
|
15
|
+
|
|
16
|
+
@NonNull
|
|
17
|
+
private final UserStatus userStatus;
|
|
18
|
+
|
|
19
|
+
@Nullable
|
|
20
|
+
private final Integer ageLower;
|
|
21
|
+
|
|
22
|
+
@Nullable
|
|
23
|
+
private final Integer ageUpper;
|
|
24
|
+
|
|
25
|
+
@Nullable
|
|
26
|
+
private final String mostRecentApprovalDate;
|
|
27
|
+
|
|
28
|
+
@Nullable
|
|
29
|
+
private final String installId;
|
|
30
|
+
|
|
31
|
+
public SetNextAgeSignalsResultOptions(@NonNull PluginCall call) throws Exception {
|
|
32
|
+
this.userStatus = SetNextAgeSignalsResultOptions.getUserStatusFromCall(call);
|
|
33
|
+
this.ageLower = call.getInt("ageLower");
|
|
34
|
+
this.ageUpper = call.getInt("ageUpper");
|
|
35
|
+
this.mostRecentApprovalDate = call.getString("mostRecentApprovalDate");
|
|
36
|
+
this.installId = call.getString("installId");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@NonNull
|
|
40
|
+
public AgeSignalsResult buildAgeSignalsResult() throws Exception {
|
|
41
|
+
AgeSignalsResult.Builder builder = AgeSignalsResult.builder();
|
|
42
|
+
|
|
43
|
+
// Set user status as integer
|
|
44
|
+
Integer verificationStatus = mapUserStatusToVerificationStatus(this.userStatus);
|
|
45
|
+
builder.setUserStatus(verificationStatus);
|
|
46
|
+
|
|
47
|
+
// Set optional fields
|
|
48
|
+
if (this.ageLower != null) {
|
|
49
|
+
builder.setAgeLower(this.ageLower);
|
|
50
|
+
}
|
|
51
|
+
if (this.ageUpper != null) {
|
|
52
|
+
builder.setAgeUpper(this.ageUpper);
|
|
53
|
+
}
|
|
54
|
+
if (this.mostRecentApprovalDate != null) {
|
|
55
|
+
Date date = parseDateString(this.mostRecentApprovalDate);
|
|
56
|
+
builder.setMostRecentApprovalDate(date);
|
|
57
|
+
}
|
|
58
|
+
if (this.installId != null) {
|
|
59
|
+
builder.setInstallId(this.installId);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return builder.build();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@NonNull
|
|
66
|
+
private static UserStatus getUserStatusFromCall(@NonNull PluginCall call) throws Exception {
|
|
67
|
+
String userStatusString = call.getString("userStatus");
|
|
68
|
+
if (userStatusString == null) {
|
|
69
|
+
throw new Exception(CustomExceptions.USER_STATUS_MISSING.getMessage());
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
return UserStatus.valueOf(userStatusString);
|
|
73
|
+
} catch (IllegalArgumentException exception) {
|
|
74
|
+
throw new Exception("Invalid userStatus: " + userStatusString);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@NonNull
|
|
79
|
+
private Integer mapUserStatusToVerificationStatus(@NonNull UserStatus userStatus) {
|
|
80
|
+
switch (userStatus) {
|
|
81
|
+
case VERIFIED:
|
|
82
|
+
return AgeSignalsVerificationStatus.VERIFIED;
|
|
83
|
+
case SUPERVISED:
|
|
84
|
+
return AgeSignalsVerificationStatus.SUPERVISED;
|
|
85
|
+
case SUPERVISED_APPROVAL_PENDING:
|
|
86
|
+
return AgeSignalsVerificationStatus.SUPERVISED_APPROVAL_PENDING;
|
|
87
|
+
case SUPERVISED_APPROVAL_DENIED:
|
|
88
|
+
return AgeSignalsVerificationStatus.SUPERVISED_APPROVAL_DENIED;
|
|
89
|
+
case UNKNOWN:
|
|
90
|
+
return AgeSignalsVerificationStatus.UNKNOWN;
|
|
91
|
+
default:
|
|
92
|
+
return AgeSignalsVerificationStatus.UNKNOWN;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@NonNull
|
|
97
|
+
private Date parseDateString(@NonNull String dateString) throws Exception {
|
|
98
|
+
try {
|
|
99
|
+
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
|
|
100
|
+
Date date = format.parse(dateString);
|
|
101
|
+
if (date == null) {
|
|
102
|
+
throw new Exception("Failed to parse date: " + dateString);
|
|
103
|
+
}
|
|
104
|
+
return date;
|
|
105
|
+
} catch (Exception exception) {
|
|
106
|
+
throw new Exception("Invalid date format. Expected yyyy-MM-dd, got: " + dateString);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.agesignals.classes.options;
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.PluginCall;
|
|
4
|
+
|
|
5
|
+
public class SetUseFakeManagerOptions {
|
|
6
|
+
|
|
7
|
+
private final boolean useFake;
|
|
8
|
+
|
|
9
|
+
public SetUseFakeManagerOptions(PluginCall call) {
|
|
10
|
+
this.useFake = call.getBoolean("useFake", false);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public boolean getUseFake() {
|
|
14
|
+
return useFake;
|
|
15
|
+
}
|
|
16
|
+
}
|
package/dist/docs.json
CHANGED
|
@@ -50,6 +50,75 @@
|
|
|
50
50
|
"CheckEligibilityResult"
|
|
51
51
|
],
|
|
52
52
|
"slug": "checkeligibility"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "setUseFakeManager",
|
|
56
|
+
"signature": "(options: SetUseFakeManagerOptions) => Promise<void>",
|
|
57
|
+
"parameters": [
|
|
58
|
+
{
|
|
59
|
+
"name": "options",
|
|
60
|
+
"docs": "",
|
|
61
|
+
"type": "SetUseFakeManagerOptions"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"returns": "Promise<void>",
|
|
65
|
+
"tags": [
|
|
66
|
+
{
|
|
67
|
+
"name": "since",
|
|
68
|
+
"text": "0.3.1"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"docs": "Enable or disable the fake age signals manager for testing.\n\nOnly available on Android.",
|
|
72
|
+
"complexTypes": [
|
|
73
|
+
"SetUseFakeManagerOptions"
|
|
74
|
+
],
|
|
75
|
+
"slug": "setusefakemanager"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "setNextAgeSignalsResult",
|
|
79
|
+
"signature": "(options: SetNextAgeSignalsResultOptions) => Promise<void>",
|
|
80
|
+
"parameters": [
|
|
81
|
+
{
|
|
82
|
+
"name": "options",
|
|
83
|
+
"docs": "",
|
|
84
|
+
"type": "SetNextAgeSignalsResultOptions"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"returns": "Promise<void>",
|
|
88
|
+
"tags": [
|
|
89
|
+
{
|
|
90
|
+
"name": "since",
|
|
91
|
+
"text": "0.3.1"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"docs": "Set the next age signals result to be returned by the fake manager.\n\nOnly available on Android.",
|
|
95
|
+
"complexTypes": [
|
|
96
|
+
"SetNextAgeSignalsResultOptions"
|
|
97
|
+
],
|
|
98
|
+
"slug": "setnextagesignalsresult"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "setNextAgeSignalsException",
|
|
102
|
+
"signature": "(options: SetNextAgeSignalsExceptionOptions) => Promise<void>",
|
|
103
|
+
"parameters": [
|
|
104
|
+
{
|
|
105
|
+
"name": "options",
|
|
106
|
+
"docs": "",
|
|
107
|
+
"type": "SetNextAgeSignalsExceptionOptions"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"returns": "Promise<void>",
|
|
111
|
+
"tags": [
|
|
112
|
+
{
|
|
113
|
+
"name": "since",
|
|
114
|
+
"text": "0.3.1"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"docs": "Set the next exception to be thrown by the fake manager.\n\nOnly available on Android.",
|
|
118
|
+
"complexTypes": [
|
|
119
|
+
"SetNextAgeSignalsExceptionOptions"
|
|
120
|
+
],
|
|
121
|
+
"slug": "setnextagesignalsexception"
|
|
53
122
|
}
|
|
54
123
|
],
|
|
55
124
|
"properties": []
|
|
@@ -206,6 +275,160 @@
|
|
|
206
275
|
"type": "boolean"
|
|
207
276
|
}
|
|
208
277
|
]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "SetUseFakeManagerOptions",
|
|
281
|
+
"slug": "setusefakemanageroptions",
|
|
282
|
+
"docs": "",
|
|
283
|
+
"tags": [
|
|
284
|
+
{
|
|
285
|
+
"text": "0.3.1",
|
|
286
|
+
"name": "since"
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"methods": [],
|
|
290
|
+
"properties": [
|
|
291
|
+
{
|
|
292
|
+
"name": "useFake",
|
|
293
|
+
"tags": [
|
|
294
|
+
{
|
|
295
|
+
"text": "0.3.1",
|
|
296
|
+
"name": "since"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"text": "false",
|
|
300
|
+
"name": "default"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"text": "true",
|
|
304
|
+
"name": "example"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"docs": "Whether to use the fake age signals manager for testing.",
|
|
308
|
+
"complexTypes": [],
|
|
309
|
+
"type": "boolean"
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"name": "SetNextAgeSignalsResultOptions",
|
|
315
|
+
"slug": "setnextagesignalsresultoptions",
|
|
316
|
+
"docs": "",
|
|
317
|
+
"tags": [
|
|
318
|
+
{
|
|
319
|
+
"text": "0.3.1",
|
|
320
|
+
"name": "since"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"methods": [],
|
|
324
|
+
"properties": [
|
|
325
|
+
{
|
|
326
|
+
"name": "userStatus",
|
|
327
|
+
"tags": [
|
|
328
|
+
{
|
|
329
|
+
"text": "0.3.1",
|
|
330
|
+
"name": "since"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"docs": "The user's verification status.",
|
|
334
|
+
"complexTypes": [
|
|
335
|
+
"UserStatus"
|
|
336
|
+
],
|
|
337
|
+
"type": "UserStatus"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "ageLower",
|
|
341
|
+
"tags": [
|
|
342
|
+
{
|
|
343
|
+
"text": "0.3.1",
|
|
344
|
+
"name": "since"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"text": "13",
|
|
348
|
+
"name": "example"
|
|
349
|
+
}
|
|
350
|
+
],
|
|
351
|
+
"docs": "The (inclusive) lower bound of a supervised user's age range.\n\nOnly available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`.",
|
|
352
|
+
"complexTypes": [],
|
|
353
|
+
"type": "number | undefined"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"name": "ageUpper",
|
|
357
|
+
"tags": [
|
|
358
|
+
{
|
|
359
|
+
"text": "0.3.1",
|
|
360
|
+
"name": "since"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"text": "15",
|
|
364
|
+
"name": "example"
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
"docs": "The (inclusive) upper bound of a supervised user's age range.\n\nOnly available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED` and the user's age is under 18.",
|
|
368
|
+
"complexTypes": [],
|
|
369
|
+
"type": "number | undefined"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "mostRecentApprovalDate",
|
|
373
|
+
"tags": [
|
|
374
|
+
{
|
|
375
|
+
"text": "0.3.1",
|
|
376
|
+
"name": "since"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"text": "\"2024-01-15\"",
|
|
380
|
+
"name": "example"
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
"docs": "The effective from date of the most recent significant change that was approved.\nWhen an app is installed, the date of the most recent significant change prior to install is used.\n\nOnly available when `userStatus` is `SUPERVISED_APPROVAL_PENDING` or `SUPERVISED_APPROVAL_DENIED`.",
|
|
384
|
+
"complexTypes": [],
|
|
385
|
+
"type": "string | undefined"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "installId",
|
|
389
|
+
"tags": [
|
|
390
|
+
{
|
|
391
|
+
"text": "0.3.1",
|
|
392
|
+
"name": "since"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"text": "\"fake_install_id\"",
|
|
396
|
+
"name": "example"
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
"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`.",
|
|
400
|
+
"complexTypes": [],
|
|
401
|
+
"type": "string | undefined"
|
|
402
|
+
}
|
|
403
|
+
]
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "SetNextAgeSignalsExceptionOptions",
|
|
407
|
+
"slug": "setnextagesignalsexceptionoptions",
|
|
408
|
+
"docs": "",
|
|
409
|
+
"tags": [
|
|
410
|
+
{
|
|
411
|
+
"text": "0.3.1",
|
|
412
|
+
"name": "since"
|
|
413
|
+
}
|
|
414
|
+
],
|
|
415
|
+
"methods": [],
|
|
416
|
+
"properties": [
|
|
417
|
+
{
|
|
418
|
+
"name": "errorCode",
|
|
419
|
+
"tags": [
|
|
420
|
+
{
|
|
421
|
+
"text": "0.3.1",
|
|
422
|
+
"name": "since"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"docs": "The error code to be thrown by the fake manager.",
|
|
426
|
+
"complexTypes": [
|
|
427
|
+
"ErrorCode"
|
|
428
|
+
],
|
|
429
|
+
"type": "ErrorCode"
|
|
430
|
+
}
|
|
431
|
+
]
|
|
209
432
|
}
|
|
210
433
|
],
|
|
211
434
|
"enums": [
|
|
@@ -280,6 +503,122 @@
|
|
|
280
503
|
"docs": "All other users return this value."
|
|
281
504
|
}
|
|
282
505
|
]
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"name": "ErrorCode",
|
|
509
|
+
"slug": "errorcode",
|
|
510
|
+
"members": [
|
|
511
|
+
{
|
|
512
|
+
"name": "ApiNotAvailable",
|
|
513
|
+
"value": "'API_NOT_AVAILABLE'",
|
|
514
|
+
"tags": [
|
|
515
|
+
{
|
|
516
|
+
"text": "0.0.1",
|
|
517
|
+
"name": "since"
|
|
518
|
+
}
|
|
519
|
+
],
|
|
520
|
+
"docs": "The Play Age Signals API is not available. The Play Store app version installed on the device might be old."
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"name": "PlayStoreNotFound",
|
|
524
|
+
"value": "'PLAY_STORE_NOT_FOUND'",
|
|
525
|
+
"tags": [
|
|
526
|
+
{
|
|
527
|
+
"text": "0.0.1",
|
|
528
|
+
"name": "since"
|
|
529
|
+
}
|
|
530
|
+
],
|
|
531
|
+
"docs": "No Play Store app is found on the device."
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "NetworkError",
|
|
535
|
+
"value": "'NETWORK_ERROR'",
|
|
536
|
+
"tags": [
|
|
537
|
+
{
|
|
538
|
+
"text": "0.0.1",
|
|
539
|
+
"name": "since"
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
"docs": "No available network is found."
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "PlayServicesNotFound",
|
|
546
|
+
"value": "'PLAY_SERVICES_NOT_FOUND'",
|
|
547
|
+
"tags": [
|
|
548
|
+
{
|
|
549
|
+
"text": "0.0.1",
|
|
550
|
+
"name": "since"
|
|
551
|
+
}
|
|
552
|
+
],
|
|
553
|
+
"docs": "Play Services is not available or its version is too old."
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"name": "CannotBindToService",
|
|
557
|
+
"value": "'CANNOT_BIND_TO_SERVICE'",
|
|
558
|
+
"tags": [
|
|
559
|
+
{
|
|
560
|
+
"text": "0.0.1",
|
|
561
|
+
"name": "since"
|
|
562
|
+
}
|
|
563
|
+
],
|
|
564
|
+
"docs": "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."
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"name": "PlayStoreVersionOutdated",
|
|
568
|
+
"value": "'PLAY_STORE_VERSION_OUTDATED'",
|
|
569
|
+
"tags": [
|
|
570
|
+
{
|
|
571
|
+
"text": "0.0.1",
|
|
572
|
+
"name": "since"
|
|
573
|
+
}
|
|
574
|
+
],
|
|
575
|
+
"docs": "The Play Store app needs to be updated."
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "PlayServicesVersionOutdated",
|
|
579
|
+
"value": "'PLAY_SERVICES_VERSION_OUTDATED'",
|
|
580
|
+
"tags": [
|
|
581
|
+
{
|
|
582
|
+
"text": "0.0.1",
|
|
583
|
+
"name": "since"
|
|
584
|
+
}
|
|
585
|
+
],
|
|
586
|
+
"docs": "Play Services needs to be updated."
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"name": "ClientTransientError",
|
|
590
|
+
"value": "'CLIENT_TRANSIENT_ERROR'",
|
|
591
|
+
"tags": [
|
|
592
|
+
{
|
|
593
|
+
"text": "0.0.1",
|
|
594
|
+
"name": "since"
|
|
595
|
+
}
|
|
596
|
+
],
|
|
597
|
+
"docs": "There was a transient error in the client device."
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"name": "AppNotOwned",
|
|
601
|
+
"value": "'APP_NOT_OWNED'",
|
|
602
|
+
"tags": [
|
|
603
|
+
{
|
|
604
|
+
"text": "0.0.1",
|
|
605
|
+
"name": "since"
|
|
606
|
+
}
|
|
607
|
+
],
|
|
608
|
+
"docs": "The app was not installed by Google Play."
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"name": "InternalError",
|
|
612
|
+
"value": "'INTERNAL_ERROR'",
|
|
613
|
+
"tags": [
|
|
614
|
+
{
|
|
615
|
+
"text": "0.0.1",
|
|
616
|
+
"name": "since"
|
|
617
|
+
}
|
|
618
|
+
],
|
|
619
|
+
"docs": "Unknown internal error."
|
|
620
|
+
}
|
|
621
|
+
]
|
|
283
622
|
}
|
|
284
623
|
],
|
|
285
624
|
"typeAliases": [],
|
|
@@ -16,6 +16,30 @@ export interface AgeSignalsPlugin {
|
|
|
16
16
|
* @since 0.3.1
|
|
17
17
|
*/
|
|
18
18
|
checkEligibility(): Promise<CheckEligibilityResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Enable or disable the fake age signals manager for testing.
|
|
21
|
+
*
|
|
22
|
+
* Only available on Android.
|
|
23
|
+
*
|
|
24
|
+
* @since 0.3.1
|
|
25
|
+
*/
|
|
26
|
+
setUseFakeManager(options: SetUseFakeManagerOptions): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Set the next age signals result to be returned by the fake manager.
|
|
29
|
+
*
|
|
30
|
+
* Only available on Android.
|
|
31
|
+
*
|
|
32
|
+
* @since 0.3.1
|
|
33
|
+
*/
|
|
34
|
+
setNextAgeSignalsResult(options: SetNextAgeSignalsResultOptions): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Set the next exception to be thrown by the fake manager.
|
|
37
|
+
*
|
|
38
|
+
* Only available on Android.
|
|
39
|
+
*
|
|
40
|
+
* @since 0.3.1
|
|
41
|
+
*/
|
|
42
|
+
setNextAgeSignalsException(options: SetNextAgeSignalsExceptionOptions): Promise<void>;
|
|
19
43
|
}
|
|
20
44
|
/**
|
|
21
45
|
* @since 0.0.2
|
|
@@ -211,3 +235,75 @@ export declare enum ErrorCode {
|
|
|
211
235
|
*/
|
|
212
236
|
InternalError = "INTERNAL_ERROR"
|
|
213
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* @since 0.3.1
|
|
240
|
+
*/
|
|
241
|
+
export interface SetUseFakeManagerOptions {
|
|
242
|
+
/**
|
|
243
|
+
* Whether to use the fake age signals manager for testing.
|
|
244
|
+
*
|
|
245
|
+
* @since 0.3.1
|
|
246
|
+
* @default false
|
|
247
|
+
* @example true
|
|
248
|
+
*/
|
|
249
|
+
useFake: boolean;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @since 0.3.1
|
|
253
|
+
*/
|
|
254
|
+
export interface SetNextAgeSignalsResultOptions {
|
|
255
|
+
/**
|
|
256
|
+
* The user's verification status.
|
|
257
|
+
*
|
|
258
|
+
* @since 0.3.1
|
|
259
|
+
*/
|
|
260
|
+
userStatus: UserStatus;
|
|
261
|
+
/**
|
|
262
|
+
* The (inclusive) lower bound of a supervised user's age range.
|
|
263
|
+
*
|
|
264
|
+
* Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`.
|
|
265
|
+
*
|
|
266
|
+
* @since 0.3.1
|
|
267
|
+
* @example 13
|
|
268
|
+
*/
|
|
269
|
+
ageLower?: number;
|
|
270
|
+
/**
|
|
271
|
+
* The (inclusive) upper bound of a supervised user's age range.
|
|
272
|
+
*
|
|
273
|
+
* Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED` and the user's age is under 18.
|
|
274
|
+
*
|
|
275
|
+
* @since 0.3.1
|
|
276
|
+
* @example 15
|
|
277
|
+
*/
|
|
278
|
+
ageUpper?: number;
|
|
279
|
+
/**
|
|
280
|
+
* The effective from date of the most recent significant change that was approved.
|
|
281
|
+
* When an app is installed, the date of the most recent significant change prior to install is used.
|
|
282
|
+
*
|
|
283
|
+
* Only available when `userStatus` is `SUPERVISED_APPROVAL_PENDING` or `SUPERVISED_APPROVAL_DENIED`.
|
|
284
|
+
*
|
|
285
|
+
* @since 0.3.1
|
|
286
|
+
* @example "2024-01-15"
|
|
287
|
+
*/
|
|
288
|
+
mostRecentApprovalDate?: string;
|
|
289
|
+
/**
|
|
290
|
+
* An ID assigned to supervised user installs by Google Play, used for the purposes of notifying you of revoked app approval.
|
|
291
|
+
*
|
|
292
|
+
* Only available when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`.
|
|
293
|
+
*
|
|
294
|
+
* @since 0.3.1
|
|
295
|
+
* @example "fake_install_id"
|
|
296
|
+
*/
|
|
297
|
+
installId?: string;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* @since 0.3.1
|
|
301
|
+
*/
|
|
302
|
+
export interface SetNextAgeSignalsExceptionOptions {
|
|
303
|
+
/**
|
|
304
|
+
* The error code to be thrown by the fake manager.
|
|
305
|
+
*
|
|
306
|
+
* @since 0.3.1
|
|
307
|
+
*/
|
|
308
|
+
errorCode: ErrorCode;
|
|
309
|
+
}
|
|
@@ -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":"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"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { AgeSignalsPlugin, CheckAgeSignalsOptions, CheckAgeSignalsResult, CheckEligibilityResult } from './definitions';
|
|
2
|
+
import type { AgeSignalsPlugin, CheckAgeSignalsOptions, CheckAgeSignalsResult, CheckEligibilityResult, SetNextAgeSignalsExceptionOptions, SetNextAgeSignalsResultOptions, SetUseFakeManagerOptions } from './definitions';
|
|
3
3
|
export declare class AgeSignalsWeb extends WebPlugin implements AgeSignalsPlugin {
|
|
4
4
|
checkAgeSignals(_options: CheckAgeSignalsOptions): Promise<CheckAgeSignalsResult>;
|
|
5
5
|
checkEligibility(): Promise<CheckEligibilityResult>;
|
|
6
|
+
setUseFakeManager(_options: SetUseFakeManagerOptions): Promise<void>;
|
|
7
|
+
setNextAgeSignalsResult(_options: SetNextAgeSignalsResultOptions): Promise<void>;
|
|
8
|
+
setNextAgeSignalsException(_options: SetNextAgeSignalsExceptionOptions): Promise<void>;
|
|
6
9
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -6,5 +6,14 @@ export class AgeSignalsWeb extends WebPlugin {
|
|
|
6
6
|
async checkEligibility() {
|
|
7
7
|
throw this.unimplemented('Not implemented on web.');
|
|
8
8
|
}
|
|
9
|
+
async setUseFakeManager(_options) {
|
|
10
|
+
throw this.unimplemented('Not implemented on web.');
|
|
11
|
+
}
|
|
12
|
+
async setNextAgeSignalsResult(_options) {
|
|
13
|
+
throw this.unimplemented('Not implemented on web.');
|
|
14
|
+
}
|
|
15
|
+
async setNextAgeSignalsException(_options) {
|
|
16
|
+
throw this.unimplemented('Not implemented on web.');
|
|
17
|
+
}
|
|
9
18
|
}
|
|
10
19
|
//# 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;AAY5C,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;IAED,KAAK,CAAC,iBAAiB,CAAC,QAAkC;QACxD,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,QAAwC;QAExC,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,0BAA0B,CAC9B,QAA2C;QAE3C,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 SetNextAgeSignalsExceptionOptions,\n SetNextAgeSignalsResultOptions,\n SetUseFakeManagerOptions,\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 async setUseFakeManager(_options: SetUseFakeManagerOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async setNextAgeSignalsResult(\n _options: SetNextAgeSignalsResultOptions,\n ): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async setNextAgeSignalsException(\n _options: SetNextAgeSignalsExceptionOptions,\n ): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -128,6 +128,15 @@ class AgeSignalsWeb extends core.WebPlugin {
|
|
|
128
128
|
async checkEligibility() {
|
|
129
129
|
throw this.unimplemented('Not implemented on web.');
|
|
130
130
|
}
|
|
131
|
+
async setUseFakeManager(_options) {
|
|
132
|
+
throw this.unimplemented('Not implemented on web.');
|
|
133
|
+
}
|
|
134
|
+
async setNextAgeSignalsResult(_options) {
|
|
135
|
+
throw this.unimplemented('Not implemented on web.');
|
|
136
|
+
}
|
|
137
|
+
async setNextAgeSignalsException(_options) {
|
|
138
|
+
throw this.unimplemented('Not implemented on web.');
|
|
139
|
+
}
|
|
131
140
|
}
|
|
132
141
|
|
|
133
142
|
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 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;;;;;;;;;"}
|
|
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 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","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,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;AACtC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,uBAAuB,CAAC,QAAQ,EAAE;AAC5C,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,0BAA0B,CAAC,QAAQ,EAAE;AAC/C,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -127,6 +127,15 @@ var capacitorAgeSignals = (function (exports, core) {
|
|
|
127
127
|
async checkEligibility() {
|
|
128
128
|
throw this.unimplemented('Not implemented on web.');
|
|
129
129
|
}
|
|
130
|
+
async setUseFakeManager(_options) {
|
|
131
|
+
throw this.unimplemented('Not implemented on web.');
|
|
132
|
+
}
|
|
133
|
+
async setNextAgeSignalsResult(_options) {
|
|
134
|
+
throw this.unimplemented('Not implemented on web.');
|
|
135
|
+
}
|
|
136
|
+
async setNextAgeSignalsException(_options) {
|
|
137
|
+
throw this.unimplemented('Not implemented on web.');
|
|
138
|
+
}
|
|
130
139
|
}
|
|
131
140
|
|
|
132
141
|
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 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;;;;;;;;;;;;;;;"}
|
|
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 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","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,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;IACtC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,uBAAuB,CAAC,QAAQ,EAAE;IAC5C,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,0BAA0B,CAAC,QAAQ,EAAE;IAC/C,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/capacitor-age-signals",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
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",
|