@capgo/capacitor-android-age-signals 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +103 -0
  3. package/android/build.gradle +59 -0
  4. package/android/src/main/AndroidManifest.xml +3 -0
  5. package/android/src/main/java/app/capgo/androidagesignals/AgeSignals.java +75 -0
  6. package/android/src/main/java/app/capgo/androidagesignals/AgeSignalsPlugin.java +78 -0
  7. package/android/src/main/java/app/capgo/androidagesignals/classes/CustomException.java +19 -0
  8. package/android/src/main/java/app/capgo/androidagesignals/classes/CustomExceptions.java +43 -0
  9. package/android/src/main/java/app/capgo/androidagesignals/classes/results/CheckAgeSignalsResult.java +72 -0
  10. package/android/src/main/java/app/capgo/androidagesignals/enums/UserStatus.java +10 -0
  11. package/android/src/main/java/app/capgo/androidagesignals/interfaces/Callback.java +5 -0
  12. package/android/src/main/java/app/capgo/androidagesignals/interfaces/NonEmptyResultCallback.java +7 -0
  13. package/android/src/main/java/app/capgo/androidagesignals/interfaces/Result.java +7 -0
  14. package/dist/docs.json +203 -0
  15. package/dist/esm/definitions.d.ts +192 -0
  16. package/dist/esm/definitions.js +123 -0
  17. package/dist/esm/definitions.js.map +1 -0
  18. package/dist/esm/index.d.ts +4 -0
  19. package/dist/esm/index.js +7 -0
  20. package/dist/esm/index.js.map +1 -0
  21. package/dist/esm/web.d.ts +5 -0
  22. package/dist/esm/web.js +7 -0
  23. package/dist/esm/web.js.map +1 -0
  24. package/dist/plugin.cjs.js +144 -0
  25. package/dist/plugin.cjs.js.map +1 -0
  26. package/dist/plugin.js +147 -0
  27. package/dist/plugin.js.map +1 -0
  28. package/package.json +75 -0
  29. package/src/definitions.ts +197 -0
  30. package/src/index.ts +10 -0
  31. package/src/web.ts +9 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Capgo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # @capgo/capacitor-android-age-signals
2
+ <a href="https://capgo.app/"><img src="https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png" alt="Capgo - Instant updates for Capacitor"/></a>
3
+
4
+ <div align="center">
5
+ <h2><a href="https://capgo.app/?ref=plugin">➡️ Ship Instant Updates with Capgo</a></h2>
6
+ <h2><a href="https://capgo.app/consulting/?ref=plugin">Missing a feature? We’ll build the plugin for you 💪</a></h2>
7
+ </div>
8
+
9
+ Capacitor wrapper for the Google Play Age Signals API. Detect supervised accounts, guardian approvals, and verified users directly from your app (Android only).
10
+
11
+ ## Documentation
12
+
13
+ Authoritative docs live inside this repo for now. Explore the TypeScript definitions in `src/definitions.ts` and the Android implementation under `android/` for platform behavior. Run the included example app for an end-to-end walkthrough.
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install @capgo/capacitor-android-age-signals
19
+ npx cap sync android
20
+ ```
21
+
22
+ Google Play Age Signals is available only on Android phones with the Play Store installed.
23
+
24
+ ## Usage
25
+
26
+ ```ts
27
+ import { AgeSignals } from '@capgo/capacitor-android-age-signals';
28
+ import { UserStatus } from '@capgo/capacitor-android-age-signals';
29
+
30
+ const result = await AgeSignals.checkAgeSignals();
31
+
32
+ if (result.userStatus === UserStatus.Supervised) {
33
+ console.info(`Supervised user aged between ${result.ageLower} and ${result.ageUpper}`);
34
+ } else if (result.userStatus === UserStatus.Verified) {
35
+ console.info('User is 18+ and verified by Google.');
36
+ } else {
37
+ console.warn('No definitive age signal returned.');
38
+ }
39
+ ```
40
+
41
+ ## API
42
+
43
+ <docgen-index>
44
+
45
+ * [`checkAgeSignals()`](#checkagesignals)
46
+ * [Interfaces](#interfaces)
47
+ * [Enums](#enums)
48
+
49
+ </docgen-index>
50
+
51
+ <docgen-api>
52
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
53
+
54
+ Capacitor interface for retrieving Play Age Signals.
55
+
56
+ ### checkAgeSignals()
57
+
58
+ ```typescript
59
+ checkAgeSignals() => Promise<CheckAgeSignalsResult>
60
+ ```
61
+
62
+ Request the current Play Age Signals for the active user.
63
+
64
+ Only available on Android devices with Google Play installed.
65
+
66
+ **Returns:** <code>Promise&lt;<a href="#checkagesignalsresult">CheckAgeSignalsResult</a>&gt;</code>
67
+
68
+ **Since:** 0.0.1
69
+
70
+ --------------------
71
+
72
+
73
+ ### Interfaces
74
+
75
+
76
+ #### CheckAgeSignalsResult
77
+
78
+ Structured result returned by {@link AgeSignalsPlugin.checkAgeSignals}.
79
+
80
+ | Prop | Type | Description | Since |
81
+ | ---------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
82
+ | **`userStatus`** | <code><a href="#userstatus">UserStatus</a></code> | The user's verification status as reported by Google Play. | 0.0.1 |
83
+ | **`ageLower`** | <code>number</code> | Inclusive lower bound of the supervised user's age range. Present only when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`. | 0.0.1 |
84
+ | **`ageUpper`** | <code>number</code> | Inclusive upper bound of the supervised user's age range. Present only when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED` and the user's age is reported as less than 18. | 0.0.1 |
85
+ | **`mostRecentApprovalDate`** | <code>string</code> | Effective date for the most recent significant change that received guardian approval. Present only when `userStatus` is `SUPERVISED_APPROVAL_PENDING` or `SUPERVISED_APPROVAL_DENIED`. | 0.0.1 |
86
+ | **`installId`** | <code>string</code> | Identifier assigned to supervised installs in Google Play for revocation notifications. Present only when `userStatus` is `SUPERVISED`, `SUPERVISED_APPROVAL_PENDING`, or `SUPERVISED_APPROVAL_DENIED`. | 0.0.1 |
87
+
88
+
89
+ ### Enums
90
+
91
+
92
+ #### UserStatus
93
+
94
+ | Members | Value | Description | Since |
95
+ | ------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
96
+ | **`Verified`** | <code>'VERIFIED'</code> | The user is over 18 and their age has been verified by Google. | 0.0.1 |
97
+ | **`Supervised`** | <code>'SUPERVISED'</code> | The user has a supervised Google Account managed by a guardian. Use `ageLower` and `ageUpper` to determine the user's age range. | 0.0.1 |
98
+ | **`SupervisedApprovalPending`** | <code>'SUPERVISED_APPROVAL_PENDING'</code> | The supervised user has pending significant changes awaiting guardian approval. Use `ageLower` and `ageUpper` to determine the user's age range and `mostRecentApprovalDate` to identify the most recent approved change. | 0.0.1 |
99
+ | **`SupervisedApprovalDenied`** | <code>'SUPERVISED_APPROVAL_DENIED'</code> | The supervised user's guardian denied one or more significant changes. Use `ageLower` and `ageUpper` to determine the user's age range and `mostRecentApprovalDate` to identify the last approved change. | 0.0.1 |
100
+ | **`Unknown`** | <code>'UNKNOWN'</code> | The user is not verified or supervised in supported regions. You should prompt the user to resolve their status in the Play Store. | 0.0.1 |
101
+ | **`Empty`** | <code>'EMPTY'</code> | All other users return this value. | 0.0.1 |
102
+
103
+ </docgen-api>
@@ -0,0 +1,59 @@
1
+ ext {
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6
+ androidPlayAgeSignalsVersion = project.hasProperty('androidPlayAgeSignalsVersion') ? rootProject.ext.androidPlayAgeSignalsVersion : '0.0.1-beta01'
7
+ }
8
+
9
+ buildscript {
10
+ repositories {
11
+ google()
12
+ mavenCentral()
13
+ }
14
+ dependencies {
15
+ classpath 'com.android.tools.build:gradle:8.7.2'
16
+ }
17
+ }
18
+
19
+ apply plugin: 'com.android.library'
20
+
21
+ android {
22
+ namespace "app.capgo.androidagesignals"
23
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
24
+ defaultConfig {
25
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
26
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
27
+ versionCode 1
28
+ versionName "1.0"
29
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
30
+ }
31
+ buildTypes {
32
+ release {
33
+ minifyEnabled false
34
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35
+ }
36
+ }
37
+ lintOptions {
38
+ abortOnError false
39
+ }
40
+ compileOptions {
41
+ sourceCompatibility JavaVersion.VERSION_21
42
+ targetCompatibility JavaVersion.VERSION_21
43
+ }
44
+ }
45
+
46
+ repositories {
47
+ google()
48
+ mavenCentral()
49
+ }
50
+
51
+ dependencies {
52
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
53
+ implementation project(':capacitor-android')
54
+ implementation "com.google.android.play:age-signals:$androidPlayAgeSignalsVersion"
55
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
56
+ testImplementation "junit:junit:$junitVersion"
57
+ androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
58
+ androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
59
+ }
@@ -0,0 +1,3 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="app.capgo.androidagesignals" />
@@ -0,0 +1,75 @@
1
+ package app.capgo.androidagesignals;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import com.google.android.gms.tasks.Task;
5
+ import com.google.android.play.agesignals.AgeSignalsManager;
6
+ import com.google.android.play.agesignals.AgeSignalsManagerFactory;
7
+ import com.google.android.play.agesignals.AgeSignalsRequest;
8
+ import com.google.android.play.agesignals.AgeSignalsResult;
9
+ import app.capgo.androidagesignals.classes.CustomExceptions;
10
+ import app.capgo.androidagesignals.classes.results.CheckAgeSignalsResult;
11
+ import app.capgo.androidagesignals.interfaces.NonEmptyResultCallback;
12
+
13
+ public class AgeSignals {
14
+
15
+ @NonNull
16
+ private final AgeSignalsPlugin plugin;
17
+
18
+ public AgeSignals(@NonNull AgeSignalsPlugin plugin) {
19
+ this.plugin = plugin;
20
+ }
21
+
22
+ public void checkAgeSignals(@NonNull NonEmptyResultCallback<CheckAgeSignalsResult> callback) {
23
+ AgeSignalsManager manager = AgeSignalsManagerFactory.create(plugin.getActivity());
24
+ AgeSignalsRequest request = AgeSignalsRequest.builder().build();
25
+
26
+ Task<AgeSignalsResult> task = manager.checkAgeSignals(request);
27
+ task.addOnSuccessListener(ageSignalsResult -> {
28
+ try {
29
+ CheckAgeSignalsResult result = new CheckAgeSignalsResult(ageSignalsResult);
30
+ callback.success(result);
31
+ } catch (Exception exception) {
32
+ callback.error(exception);
33
+ }
34
+ });
35
+ task.addOnFailureListener(exception -> {
36
+ Exception mapped = mapErrorToException(exception);
37
+ callback.error(mapped);
38
+ });
39
+ }
40
+
41
+ @NonNull
42
+ private Exception mapErrorToException(@NonNull Exception exception) {
43
+ if (!(exception instanceof com.google.android.gms.common.api.ApiException)) {
44
+ return exception;
45
+ }
46
+
47
+ com.google.android.gms.common.api.ApiException apiException = (com.google.android.gms.common.api.ApiException) exception;
48
+ int statusCode = apiException.getStatusCode();
49
+
50
+ switch (statusCode) {
51
+ case 25000:
52
+ return CustomExceptions.API_NOT_AVAILABLE;
53
+ case 25001:
54
+ return CustomExceptions.PLAY_STORE_NOT_FOUND;
55
+ case 25002:
56
+ return CustomExceptions.NETWORK_ERROR;
57
+ case 25003:
58
+ return CustomExceptions.PLAY_SERVICES_NOT_FOUND;
59
+ case 25004:
60
+ return CustomExceptions.CANNOT_BIND_TO_SERVICE;
61
+ case 25005:
62
+ return CustomExceptions.PLAY_STORE_VERSION_OUTDATED;
63
+ case 25006:
64
+ return CustomExceptions.PLAY_SERVICES_VERSION_OUTDATED;
65
+ case 25007:
66
+ return CustomExceptions.CLIENT_TRANSIENT_ERROR;
67
+ case 25008:
68
+ return CustomExceptions.APP_NOT_OWNED;
69
+ case 25009:
70
+ return CustomExceptions.INTERNAL_ERROR;
71
+ default:
72
+ return exception;
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,78 @@
1
+ package app.capgo.androidagesignals;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import androidx.annotation.Nullable;
5
+ import com.getcapacitor.JSObject;
6
+ import com.getcapacitor.Logger;
7
+ import com.getcapacitor.Plugin;
8
+ import com.getcapacitor.PluginCall;
9
+ import com.getcapacitor.PluginMethod;
10
+ import com.getcapacitor.annotation.CapacitorPlugin;
11
+ import app.capgo.androidagesignals.classes.results.CheckAgeSignalsResult;
12
+ import app.capgo.androidagesignals.interfaces.NonEmptyResultCallback;
13
+ import app.capgo.androidagesignals.interfaces.Result;
14
+
15
+ @CapacitorPlugin(name = "AgeSignals")
16
+ public class AgeSignalsPlugin extends Plugin {
17
+ public static final String TAG = "AgeSignals";
18
+ private static final String ERROR_UNKNOWN = "An unknown error occurred.";
19
+
20
+ private AgeSignals implementation;
21
+
22
+ @Override
23
+ public void load() {
24
+ implementation = new AgeSignals(this);
25
+ }
26
+
27
+ @PluginMethod
28
+ public void checkAgeSignals(@NonNull PluginCall call) {
29
+ try {
30
+ NonEmptyResultCallback<CheckAgeSignalsResult> callback = new NonEmptyResultCallback<>() {
31
+ @Override
32
+ public void success(@NonNull CheckAgeSignalsResult result) {
33
+ resolveCall(call, result);
34
+ }
35
+
36
+ @Override
37
+ public void error(@NonNull Exception exception) {
38
+ rejectCall(call, exception);
39
+ }
40
+ };
41
+
42
+ if (implementation == null) {
43
+ rejectCall(call, new Exception("Plugin not initialized."));
44
+ return;
45
+ }
46
+
47
+ implementation.checkAgeSignals(callback);
48
+ } catch (Exception exception) {
49
+ rejectCall(call, exception);
50
+ }
51
+ }
52
+
53
+ private void rejectCall(@NonNull PluginCall call, @NonNull Exception exception) {
54
+ String message = exception.getMessage();
55
+ if (message == null || message.isEmpty()) {
56
+ message = ERROR_UNKNOWN;
57
+ }
58
+ Logger.error(TAG, message, exception);
59
+
60
+ if (exception instanceof app.capgo.androidagesignals.classes.CustomException) {
61
+ JSObject error = new JSObject();
62
+ app.capgo.androidagesignals.classes.CustomException customException = (app.capgo.androidagesignals.classes.CustomException) exception;
63
+ error.put("code", customException.getCode());
64
+ error.put("message", message);
65
+ call.reject(message, customException.getCode(), error);
66
+ } else {
67
+ call.reject(message);
68
+ }
69
+ }
70
+
71
+ private void resolveCall(@NonNull PluginCall call, @Nullable Result result) {
72
+ if (result == null) {
73
+ call.resolve();
74
+ } else {
75
+ call.resolve(result.toJSObject());
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,19 @@
1
+ package app.capgo.androidagesignals.classes;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import androidx.annotation.Nullable;
5
+
6
+ public class CustomException extends Exception {
7
+ @Nullable
8
+ private final String code;
9
+
10
+ public CustomException(@Nullable String code, @NonNull String message) {
11
+ super(message);
12
+ this.code = code;
13
+ }
14
+
15
+ @Nullable
16
+ public String getCode() {
17
+ return code;
18
+ }
19
+ }
@@ -0,0 +1,43 @@
1
+ package app.capgo.androidagesignals.classes;
2
+
3
+ public final class CustomExceptions {
4
+ private CustomExceptions() {}
5
+
6
+ public static final CustomException API_NOT_AVAILABLE = new CustomException(
7
+ "API_NOT_AVAILABLE",
8
+ "The Play Age Signals API is not available. The installed Play Store might be outdated."
9
+ );
10
+ public static final CustomException PLAY_STORE_NOT_FOUND = new CustomException(
11
+ "PLAY_STORE_NOT_FOUND",
12
+ "Google Play Store is not installed on this device."
13
+ );
14
+ public static final CustomException NETWORK_ERROR = new CustomException("NETWORK_ERROR", "No available network connection.");
15
+ public static final CustomException PLAY_SERVICES_NOT_FOUND = new CustomException(
16
+ "PLAY_SERVICES_NOT_FOUND",
17
+ "Google Play services is missing or out of date."
18
+ );
19
+ public static final CustomException CANNOT_BIND_TO_SERVICE = new CustomException(
20
+ "CANNOT_BIND_TO_SERVICE",
21
+ "Failed to bind to the Google Play service. The Play Store may be outdated or resources are low."
22
+ );
23
+ public static final CustomException PLAY_STORE_VERSION_OUTDATED = new CustomException(
24
+ "PLAY_STORE_VERSION_OUTDATED",
25
+ "Update Google Play Store to continue."
26
+ );
27
+ public static final CustomException PLAY_SERVICES_VERSION_OUTDATED = new CustomException(
28
+ "PLAY_SERVICES_VERSION_OUTDATED",
29
+ "Update Google Play services to continue."
30
+ );
31
+ public static final CustomException CLIENT_TRANSIENT_ERROR = new CustomException(
32
+ "CLIENT_TRANSIENT_ERROR",
33
+ "A transient error occurred on the device. Retry the request."
34
+ );
35
+ public static final CustomException APP_NOT_OWNED = new CustomException(
36
+ "APP_NOT_OWNED",
37
+ "The app was not installed from Google Play."
38
+ );
39
+ public static final CustomException INTERNAL_ERROR = new CustomException(
40
+ "INTERNAL_ERROR",
41
+ "An unknown internal error occurred."
42
+ );
43
+ }
@@ -0,0 +1,72 @@
1
+ package app.capgo.androidagesignals.classes.results;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import androidx.annotation.Nullable;
5
+ import com.getcapacitor.JSObject;
6
+ import com.google.android.play.agesignals.AgeSignalsResult;
7
+ import app.capgo.androidagesignals.enums.UserStatus;
8
+ import app.capgo.androidagesignals.interfaces.Result;
9
+
10
+ public class CheckAgeSignalsResult implements Result {
11
+ @NonNull
12
+ private final UserStatus userStatus;
13
+
14
+ @Nullable
15
+ private final Integer ageLower;
16
+
17
+ @Nullable
18
+ private final Integer ageUpper;
19
+
20
+ @Nullable
21
+ private final String mostRecentApprovalDate;
22
+
23
+ @Nullable
24
+ private final String installId;
25
+
26
+ public CheckAgeSignalsResult(@NonNull AgeSignalsResult ageSignalsResult) {
27
+ this.userStatus = mapUserStatus(ageSignalsResult.userStatus().toString());
28
+ this.ageLower = ageSignalsResult.ageLower();
29
+ this.ageUpper = ageSignalsResult.ageUpper();
30
+ this.mostRecentApprovalDate =
31
+ ageSignalsResult.mostRecentApprovalDate() != null ? ageSignalsResult.mostRecentApprovalDate().toString() : null;
32
+ this.installId = ageSignalsResult.installId();
33
+ }
34
+
35
+ @Override
36
+ @NonNull
37
+ public JSObject toJSObject() {
38
+ JSObject result = new JSObject();
39
+ result.put("userStatus", userStatus.name());
40
+ if (ageLower != null) {
41
+ result.put("ageLower", ageLower);
42
+ }
43
+ if (ageUpper != null) {
44
+ result.put("ageUpper", ageUpper);
45
+ }
46
+ if (mostRecentApprovalDate != null) {
47
+ result.put("mostRecentApprovalDate", mostRecentApprovalDate);
48
+ }
49
+ if (installId != null) {
50
+ result.put("installId", installId);
51
+ }
52
+ return result;
53
+ }
54
+
55
+ @NonNull
56
+ private UserStatus mapUserStatus(@NonNull String status) {
57
+ switch (status) {
58
+ case "VERIFIED":
59
+ return UserStatus.VERIFIED;
60
+ case "SUPERVISED":
61
+ return UserStatus.SUPERVISED;
62
+ case "SUPERVISED_APPROVAL_PENDING":
63
+ return UserStatus.SUPERVISED_APPROVAL_PENDING;
64
+ case "SUPERVISED_APPROVAL_DENIED":
65
+ return UserStatus.SUPERVISED_APPROVAL_DENIED;
66
+ case "UNKNOWN":
67
+ return UserStatus.UNKNOWN;
68
+ default:
69
+ return UserStatus.EMPTY;
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,10 @@
1
+ package app.capgo.androidagesignals.enums;
2
+
3
+ public enum UserStatus {
4
+ VERIFIED,
5
+ SUPERVISED,
6
+ SUPERVISED_APPROVAL_PENDING,
7
+ SUPERVISED_APPROVAL_DENIED,
8
+ UNKNOWN,
9
+ EMPTY
10
+ }
@@ -0,0 +1,5 @@
1
+ package app.capgo.androidagesignals.interfaces;
2
+
3
+ public interface Callback {
4
+ void error(Exception exception);
5
+ }
@@ -0,0 +1,7 @@
1
+ package app.capgo.androidagesignals.interfaces;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ public interface NonEmptyResultCallback<T extends Result> extends Callback {
6
+ void success(@NonNull T result);
7
+ }
@@ -0,0 +1,7 @@
1
+ package app.capgo.androidagesignals.interfaces;
2
+
3
+ import com.getcapacitor.JSObject;
4
+
5
+ public interface Result {
6
+ JSObject toJSObject();
7
+ }