@capawesome/capacitor-age-signals 0.1.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/CapawesomeCapacitorAgeSignals.podspec +17 -0
- package/LICENSE +201 -0
- package/Package.swift +28 -0
- package/README.md +111 -0
- package/android/build.gradle +60 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignals.java +75 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/AgeSignalsPlugin.java +69 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/CustomException.java +20 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/CustomExceptions.java +36 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/classes/results/CheckAgeSignalsResult.java +73 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/enums/UserStatus.java +10 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/interfaces/Callback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/interfaces/EmptyCallback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/interfaces/NonEmptyCallback.java +7 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/interfaces/NonEmptyResultCallback.java +7 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/agesignals/interfaces/Result.java +7 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +203 -0
- package/dist/esm/definitions.d.ts +173 -0
- package/dist/esm/definitions.js +115 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +5 -0
- package/dist/esm/web.js +7 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +136 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +139 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/AgeSignalsPlugin.swift +15 -0
- package/ios/Plugin/Info.plist +24 -0
- package/package.json +93 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
*/
|
|
8
|
+
exports.UserStatus = void 0;
|
|
9
|
+
(function (UserStatus) {
|
|
10
|
+
/**
|
|
11
|
+
* 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.
|
|
12
|
+
*
|
|
13
|
+
* @since 0.0.1
|
|
14
|
+
*/
|
|
15
|
+
UserStatus["Verified"] = "VERIFIED";
|
|
16
|
+
/**
|
|
17
|
+
* The user has a supervised Google Account managed by a parent who sets their age.
|
|
18
|
+
* Use `ageLower` and `ageUpper` to determine the user's age range.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.0.1
|
|
21
|
+
*/
|
|
22
|
+
UserStatus["Supervised"] = "SUPERVISED";
|
|
23
|
+
/**
|
|
24
|
+
* The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes.
|
|
25
|
+
* Use `ageLower` and `ageUpper` to determine the user's age range.
|
|
26
|
+
* Use `mostRecentApprovalDate` to determine the last significant change that was approved.
|
|
27
|
+
*
|
|
28
|
+
* @since 0.0.1
|
|
29
|
+
*/
|
|
30
|
+
UserStatus["SupervisedApprovalPending"] = "SUPERVISED_APPROVAL_PENDING";
|
|
31
|
+
/**
|
|
32
|
+
* The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes.
|
|
33
|
+
* Use `ageLower` and `ageUpper` to determine the user's age range.
|
|
34
|
+
* Use `mostRecentApprovalDate` to determine the last significant change that was approved.
|
|
35
|
+
*
|
|
36
|
+
* @since 0.0.1
|
|
37
|
+
*/
|
|
38
|
+
UserStatus["SupervisedApprovalDenied"] = "SUPERVISED_APPROVAL_DENIED";
|
|
39
|
+
/**
|
|
40
|
+
* The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18.
|
|
41
|
+
* To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.
|
|
42
|
+
*
|
|
43
|
+
* @since 0.0.1
|
|
44
|
+
*/
|
|
45
|
+
UserStatus["Unknown"] = "UNKNOWN";
|
|
46
|
+
/**
|
|
47
|
+
* All other users return this value.
|
|
48
|
+
*
|
|
49
|
+
* @since 0.0.1
|
|
50
|
+
*/
|
|
51
|
+
UserStatus["Empty"] = "EMPTY";
|
|
52
|
+
})(exports.UserStatus || (exports.UserStatus = {}));
|
|
53
|
+
/**
|
|
54
|
+
* @since 0.0.1
|
|
55
|
+
*/
|
|
56
|
+
exports.ErrorCode = void 0;
|
|
57
|
+
(function (ErrorCode) {
|
|
58
|
+
/**
|
|
59
|
+
* The Play Age Signals API is not available. The Play Store app version installed on the device might be old.
|
|
60
|
+
*
|
|
61
|
+
* @since 0.0.1
|
|
62
|
+
*/
|
|
63
|
+
ErrorCode["ApiNotAvailable"] = "API_NOT_AVAILABLE";
|
|
64
|
+
/**
|
|
65
|
+
* No Play Store app is found on the device.
|
|
66
|
+
*
|
|
67
|
+
* @since 0.0.1
|
|
68
|
+
*/
|
|
69
|
+
ErrorCode["PlayStoreNotFound"] = "PLAY_STORE_NOT_FOUND";
|
|
70
|
+
/**
|
|
71
|
+
* No available network is found.
|
|
72
|
+
*
|
|
73
|
+
* @since 0.0.1
|
|
74
|
+
*/
|
|
75
|
+
ErrorCode["NetworkError"] = "NETWORK_ERROR";
|
|
76
|
+
/**
|
|
77
|
+
* Play Services is not available or its version is too old.
|
|
78
|
+
*
|
|
79
|
+
* @since 0.0.1
|
|
80
|
+
*/
|
|
81
|
+
ErrorCode["PlayServicesNotFound"] = "PLAY_SERVICES_NOT_FOUND";
|
|
82
|
+
/**
|
|
83
|
+
* 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.
|
|
84
|
+
*
|
|
85
|
+
* @since 0.0.1
|
|
86
|
+
*/
|
|
87
|
+
ErrorCode["CannotBindToService"] = "CANNOT_BIND_TO_SERVICE";
|
|
88
|
+
/**
|
|
89
|
+
* The Play Store app needs to be updated.
|
|
90
|
+
*
|
|
91
|
+
* @since 0.0.1
|
|
92
|
+
*/
|
|
93
|
+
ErrorCode["PlayStoreVersionOutdated"] = "PLAY_STORE_VERSION_OUTDATED";
|
|
94
|
+
/**
|
|
95
|
+
* Play Services needs to be updated.
|
|
96
|
+
*
|
|
97
|
+
* @since 0.0.1
|
|
98
|
+
*/
|
|
99
|
+
ErrorCode["PlayServicesVersionOutdated"] = "PLAY_SERVICES_VERSION_OUTDATED";
|
|
100
|
+
/**
|
|
101
|
+
* There was a transient error in the client device.
|
|
102
|
+
*
|
|
103
|
+
* @since 0.0.1
|
|
104
|
+
*/
|
|
105
|
+
ErrorCode["ClientTransientError"] = "CLIENT_TRANSIENT_ERROR";
|
|
106
|
+
/**
|
|
107
|
+
* The app was not installed by Google Play.
|
|
108
|
+
*
|
|
109
|
+
* @since 0.0.1
|
|
110
|
+
*/
|
|
111
|
+
ErrorCode["AppNotOwned"] = "APP_NOT_OWNED";
|
|
112
|
+
/**
|
|
113
|
+
* Unknown internal error.
|
|
114
|
+
*
|
|
115
|
+
* @since 0.0.1
|
|
116
|
+
*/
|
|
117
|
+
ErrorCode["InternalError"] = "INTERNAL_ERROR";
|
|
118
|
+
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
119
|
+
|
|
120
|
+
const AgeSignals = core.registerPlugin('AgeSignals', {
|
|
121
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AgeSignalsWeb()),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
class AgeSignalsWeb extends core.WebPlugin {
|
|
125
|
+
async checkAgeSignals() {
|
|
126
|
+
throw this.unimplemented('Not implemented on web.');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
131
|
+
__proto__: null,
|
|
132
|
+
AgeSignalsWeb: AgeSignalsWeb
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
exports.AgeSignals = AgeSignals;
|
|
136
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +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() {\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,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D;AACA;;;;;;;;;"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
var capacitorAgeSignals = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.0.1
|
|
6
|
+
*/
|
|
7
|
+
exports.UserStatus = void 0;
|
|
8
|
+
(function (UserStatus) {
|
|
9
|
+
/**
|
|
10
|
+
* 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.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.0.1
|
|
13
|
+
*/
|
|
14
|
+
UserStatus["Verified"] = "VERIFIED";
|
|
15
|
+
/**
|
|
16
|
+
* The user has a supervised Google Account managed by a parent who sets their age.
|
|
17
|
+
* Use `ageLower` and `ageUpper` to determine the user's age range.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.0.1
|
|
20
|
+
*/
|
|
21
|
+
UserStatus["Supervised"] = "SUPERVISED";
|
|
22
|
+
/**
|
|
23
|
+
* The user has a supervised Google Account, and their supervising parent has not yet approved one or more pending significant changes.
|
|
24
|
+
* Use `ageLower` and `ageUpper` to determine the user's age range.
|
|
25
|
+
* Use `mostRecentApprovalDate` to determine the last significant change that was approved.
|
|
26
|
+
*
|
|
27
|
+
* @since 0.0.1
|
|
28
|
+
*/
|
|
29
|
+
UserStatus["SupervisedApprovalPending"] = "SUPERVISED_APPROVAL_PENDING";
|
|
30
|
+
/**
|
|
31
|
+
* The user has a supervised Google Account, and their supervising parent denied approval for one or more significant changes.
|
|
32
|
+
* Use `ageLower` and `ageUpper` to determine the user's age range.
|
|
33
|
+
* Use `mostRecentApprovalDate` to determine the last significant change that was approved.
|
|
34
|
+
*
|
|
35
|
+
* @since 0.0.1
|
|
36
|
+
*/
|
|
37
|
+
UserStatus["SupervisedApprovalDenied"] = "SUPERVISED_APPROVAL_DENIED";
|
|
38
|
+
/**
|
|
39
|
+
* The user is not verified or supervised in applicable jurisdictions and regions. These users could be over or under 18.
|
|
40
|
+
* To obtain an age signal from Google Play, ask the user to visit the Play Store to resolve their status.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.0.1
|
|
43
|
+
*/
|
|
44
|
+
UserStatus["Unknown"] = "UNKNOWN";
|
|
45
|
+
/**
|
|
46
|
+
* All other users return this value.
|
|
47
|
+
*
|
|
48
|
+
* @since 0.0.1
|
|
49
|
+
*/
|
|
50
|
+
UserStatus["Empty"] = "EMPTY";
|
|
51
|
+
})(exports.UserStatus || (exports.UserStatus = {}));
|
|
52
|
+
/**
|
|
53
|
+
* @since 0.0.1
|
|
54
|
+
*/
|
|
55
|
+
exports.ErrorCode = void 0;
|
|
56
|
+
(function (ErrorCode) {
|
|
57
|
+
/**
|
|
58
|
+
* The Play Age Signals API is not available. The Play Store app version installed on the device might be old.
|
|
59
|
+
*
|
|
60
|
+
* @since 0.0.1
|
|
61
|
+
*/
|
|
62
|
+
ErrorCode["ApiNotAvailable"] = "API_NOT_AVAILABLE";
|
|
63
|
+
/**
|
|
64
|
+
* No Play Store app is found on the device.
|
|
65
|
+
*
|
|
66
|
+
* @since 0.0.1
|
|
67
|
+
*/
|
|
68
|
+
ErrorCode["PlayStoreNotFound"] = "PLAY_STORE_NOT_FOUND";
|
|
69
|
+
/**
|
|
70
|
+
* No available network is found.
|
|
71
|
+
*
|
|
72
|
+
* @since 0.0.1
|
|
73
|
+
*/
|
|
74
|
+
ErrorCode["NetworkError"] = "NETWORK_ERROR";
|
|
75
|
+
/**
|
|
76
|
+
* Play Services is not available or its version is too old.
|
|
77
|
+
*
|
|
78
|
+
* @since 0.0.1
|
|
79
|
+
*/
|
|
80
|
+
ErrorCode["PlayServicesNotFound"] = "PLAY_SERVICES_NOT_FOUND";
|
|
81
|
+
/**
|
|
82
|
+
* 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.
|
|
83
|
+
*
|
|
84
|
+
* @since 0.0.1
|
|
85
|
+
*/
|
|
86
|
+
ErrorCode["CannotBindToService"] = "CANNOT_BIND_TO_SERVICE";
|
|
87
|
+
/**
|
|
88
|
+
* The Play Store app needs to be updated.
|
|
89
|
+
*
|
|
90
|
+
* @since 0.0.1
|
|
91
|
+
*/
|
|
92
|
+
ErrorCode["PlayStoreVersionOutdated"] = "PLAY_STORE_VERSION_OUTDATED";
|
|
93
|
+
/**
|
|
94
|
+
* Play Services needs to be updated.
|
|
95
|
+
*
|
|
96
|
+
* @since 0.0.1
|
|
97
|
+
*/
|
|
98
|
+
ErrorCode["PlayServicesVersionOutdated"] = "PLAY_SERVICES_VERSION_OUTDATED";
|
|
99
|
+
/**
|
|
100
|
+
* There was a transient error in the client device.
|
|
101
|
+
*
|
|
102
|
+
* @since 0.0.1
|
|
103
|
+
*/
|
|
104
|
+
ErrorCode["ClientTransientError"] = "CLIENT_TRANSIENT_ERROR";
|
|
105
|
+
/**
|
|
106
|
+
* The app was not installed by Google Play.
|
|
107
|
+
*
|
|
108
|
+
* @since 0.0.1
|
|
109
|
+
*/
|
|
110
|
+
ErrorCode["AppNotOwned"] = "APP_NOT_OWNED";
|
|
111
|
+
/**
|
|
112
|
+
* Unknown internal error.
|
|
113
|
+
*
|
|
114
|
+
* @since 0.0.1
|
|
115
|
+
*/
|
|
116
|
+
ErrorCode["InternalError"] = "INTERNAL_ERROR";
|
|
117
|
+
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
118
|
+
|
|
119
|
+
const AgeSignals = core.registerPlugin('AgeSignals', {
|
|
120
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AgeSignalsWeb()),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
class AgeSignalsWeb extends core.WebPlugin {
|
|
124
|
+
async checkAgeSignals() {
|
|
125
|
+
throw this.unimplemented('Not implemented on web.');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
130
|
+
__proto__: null,
|
|
131
|
+
AgeSignalsWeb: AgeSignalsWeb
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
exports.AgeSignals = AgeSignals;
|
|
135
|
+
|
|
136
|
+
return exports;
|
|
137
|
+
|
|
138
|
+
})({}, capacitorExports);
|
|
139
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +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() {\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,GAAG;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D;IACA;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
@objc(AgeSignalsPlugin)
|
|
5
|
+
public class AgeSignalsPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
6
|
+
public let identifier = "AgeSignalsPlugin"
|
|
7
|
+
public let jsName = "AgeSignals"
|
|
8
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
9
|
+
CAPPluginMethod(name: "checkAgeSignals", returnType: CAPPluginReturnPromise)
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
@objc func checkAgeSignals(_ call: CAPPluginCall) {
|
|
13
|
+
call.unimplemented("Not implemented on iOS.")
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
+
<key>NSPrincipalClass</key>
|
|
22
|
+
<string></string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@capawesome/capacitor-age-signals",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Capacitor plugin to use the Play Age Signals API to retrieve age-related signals for users.",
|
|
5
|
+
"main": "dist/plugin.cjs.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/esm/index.d.ts",
|
|
8
|
+
"unpkg": "dist/plugin.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"android/src/main/",
|
|
11
|
+
"android/build.gradle",
|
|
12
|
+
"dist/",
|
|
13
|
+
"ios/Plugin/",
|
|
14
|
+
"CapawesomeCapacitorAgeSignals.podspec",
|
|
15
|
+
"Package.swift"
|
|
16
|
+
],
|
|
17
|
+
"author": "Robin Genz <mail@robingenz.dev>",
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/capawesome-team/capacitor-plugins.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/capawesome-team/capacitor-plugins/issues"
|
|
25
|
+
},
|
|
26
|
+
"funding": [
|
|
27
|
+
{
|
|
28
|
+
"type": "github",
|
|
29
|
+
"url": "https://github.com/sponsors/capawesome-team/"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "opencollective",
|
|
33
|
+
"url": "https://opencollective.com/capawesome"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"keywords": [
|
|
37
|
+
"capacitor",
|
|
38
|
+
"plugin",
|
|
39
|
+
"native"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
43
|
+
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
|
|
44
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
45
|
+
"verify:web": "npm run build",
|
|
46
|
+
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
47
|
+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
48
|
+
"eslint": "eslint . --ext ts",
|
|
49
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
50
|
+
"swiftlint": "node-swiftlint",
|
|
51
|
+
"docgen": "docgen --api AgeSignalsPlugin --output-readme README.md --output-json dist/docs.json",
|
|
52
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
53
|
+
"clean": "rimraf ./dist",
|
|
54
|
+
"watch": "tsc --watch",
|
|
55
|
+
"ios:pod:install": "cd ios && pod install --repo-update && cd ..",
|
|
56
|
+
"ios:spm:install": "cd ios && swift package resolve && cd ..",
|
|
57
|
+
"prepublishOnly": "npm run build"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@capacitor/android": "7.0.0",
|
|
61
|
+
"@capacitor/cli": "7.0.0",
|
|
62
|
+
"@capacitor/core": "7.0.0",
|
|
63
|
+
"@capacitor/docgen": "0.3.0",
|
|
64
|
+
"@capacitor/ios": "7.0.0",
|
|
65
|
+
"@ionic/eslint-config": "0.4.0",
|
|
66
|
+
"@ionic/swiftlint-config": "2.0.0",
|
|
67
|
+
"eslint": "8.57.0",
|
|
68
|
+
"prettier": "3.4.2",
|
|
69
|
+
"prettier-plugin-java": "2.6.7",
|
|
70
|
+
"rimraf": "6.0.1",
|
|
71
|
+
"rollup": "4.30.1",
|
|
72
|
+
"swiftlint": "2.0.0",
|
|
73
|
+
"typescript": "4.1.5"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"@capacitor/core": ">=7.0.0"
|
|
77
|
+
},
|
|
78
|
+
"swiftlint": "@ionic/swiftlint-config",
|
|
79
|
+
"eslintConfig": {
|
|
80
|
+
"extends": "@ionic/eslint-config/recommended"
|
|
81
|
+
},
|
|
82
|
+
"capacitor": {
|
|
83
|
+
"ios": {
|
|
84
|
+
"src": "ios"
|
|
85
|
+
},
|
|
86
|
+
"android": {
|
|
87
|
+
"src": "android"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"publishConfig": {
|
|
91
|
+
"access": "public"
|
|
92
|
+
}
|
|
93
|
+
}
|