@capawesome/capacitor-age-signals 0.1.1 → 0.2.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
CHANGED
|
@@ -8,6 +8,10 @@ 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
|
+
|
|
11
15
|
## Installation
|
|
12
16
|
|
|
13
17
|
```bash
|
|
@@ -21,7 +25,7 @@ npx cap sync
|
|
|
21
25
|
|
|
22
26
|
If needed, you can define the following project variable in your app's `variables.gradle` file to change the default version of the dependency:
|
|
23
27
|
|
|
24
|
-
- `$androidPlayAgeSignalsVersion` version of `com.google.android.play:age-signals` (default: `0.0.1-
|
|
28
|
+
- `$androidPlayAgeSignalsVersion` version of `com.google.android.play:age-signals` (default: `0.0.1-beta02`)
|
|
25
29
|
|
|
26
30
|
This can be useful if you encounter dependency conflicts with other plugins in your project.
|
|
27
31
|
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ ext {
|
|
|
3
3
|
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
4
4
|
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
5
5
|
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
6
|
-
androidPlayAgeSignalsVersion = project.hasProperty('androidPlayAgeSignalsVersion') ? rootProject.ext.androidPlayAgeSignalsVersion : '0.0.1-
|
|
6
|
+
androidPlayAgeSignalsVersion = project.hasProperty('androidPlayAgeSignalsVersion') ? rootProject.ext.androidPlayAgeSignalsVersion : '0.0.1-beta02'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
@@ -25,7 +25,7 @@ public class CheckAgeSignalsResult implements Result {
|
|
|
25
25
|
private final String installId;
|
|
26
26
|
|
|
27
27
|
public CheckAgeSignalsResult(@NonNull AgeSignalsResult ageSignalsResult) {
|
|
28
|
-
this.userStatus = mapUserStatus(ageSignalsResult.userStatus()
|
|
28
|
+
this.userStatus = mapUserStatus(ageSignalsResult.userStatus());
|
|
29
29
|
this.ageLower = ageSignalsResult.ageLower();
|
|
30
30
|
this.ageUpper = ageSignalsResult.ageUpper();
|
|
31
31
|
this.mostRecentApprovalDate = ageSignalsResult.mostRecentApprovalDate() != null
|
|
@@ -54,20 +54,17 @@ public class CheckAgeSignalsResult implements Result {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
@NonNull
|
|
57
|
-
private UserStatus mapUserStatus(@
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return UserStatus.VERIFIED;
|
|
61
|
-
case "SUPERVISED":
|
|
62
|
-
return UserStatus.SUPERVISED;
|
|
63
|
-
case "SUPERVISED_APPROVAL_PENDING":
|
|
64
|
-
return UserStatus.SUPERVISED_APPROVAL_PENDING;
|
|
65
|
-
case "SUPERVISED_APPROVAL_DENIED":
|
|
66
|
-
return UserStatus.SUPERVISED_APPROVAL_DENIED;
|
|
67
|
-
case "UNKNOWN":
|
|
68
|
-
return UserStatus.UNKNOWN;
|
|
69
|
-
default:
|
|
70
|
-
return UserStatus.EMPTY;
|
|
57
|
+
private UserStatus mapUserStatus(@Nullable Integer status) {
|
|
58
|
+
if (status == null) {
|
|
59
|
+
return UserStatus.EMPTY;
|
|
71
60
|
}
|
|
61
|
+
|
|
62
|
+
UserStatus[] values = UserStatus.values();
|
|
63
|
+
|
|
64
|
+
if (status < 0 || status >= values.length) {
|
|
65
|
+
throw new IllegalArgumentException("Invalid UserStatus: " + status);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return values[status];
|
|
72
69
|
}
|
|
73
70
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/capacitor-age-signals",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|