@cap-kit/rank 8.0.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/CapKitRank.podspec +17 -0
- package/LICENSE +21 -0
- package/Package.swift +28 -0
- package/README.md +574 -0
- package/android/build.gradle +110 -0
- package/android/src/main/AndroidManifest.xml +16 -0
- package/android/src/main/java/io/capkit/rank/RankConfig.kt +72 -0
- package/android/src/main/java/io/capkit/rank/RankError.kt +40 -0
- package/android/src/main/java/io/capkit/rank/RankImpl.kt +240 -0
- package/android/src/main/java/io/capkit/rank/RankPlugin.kt +312 -0
- package/android/src/main/java/io/capkit/rank/utils/RankLogger.kt +85 -0
- package/android/src/main/java/io/capkit/rank/utils/RankUtils.kt +14 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +441 -0
- package/dist/esm/definitions.d.ts +330 -0
- package/dist/esm/definitions.js +21 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +81 -0
- package/dist/esm/web.js +157 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +204 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +207 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/RankPlugin/RankConfig.swift +89 -0
- package/ios/Sources/RankPlugin/RankError.swift +49 -0
- package/ios/Sources/RankPlugin/RankImpl.swift +186 -0
- package/ios/Sources/RankPlugin/RankPlugin.swift +258 -0
- package/ios/Sources/RankPlugin/Utils/RankLogger.swift +69 -0
- package/ios/Sources/RankPlugin/Utils/RankUtils.swift +45 -0
- package/ios/Sources/RankPlugin/Version.swift +16 -0
- package/ios/Tests/RankPluginTests/RankPluginTests.swift +10 -0
- package/package.json +102 -0
package/dist/docs.json
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "RankPlugin",
|
|
4
|
+
"slug": "rankplugin",
|
|
5
|
+
"docs": "Public JavaScript API for the Rank Capacitor plugin.\n\nThis interface defines a stable, platform-agnostic API.\nAll methods behave consistently across Android, iOS, and Web.",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "isAvailable",
|
|
10
|
+
"signature": "() => Promise<AvailabilityResult>",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "Promise<AvailabilityResult>",
|
|
13
|
+
"tags": [
|
|
14
|
+
{
|
|
15
|
+
"name": "returns",
|
|
16
|
+
"text": "A promise resolving to an AvailabilityResult object."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "example",
|
|
20
|
+
"text": "```ts\nconst { value } = await Rank.isAvailable();\nif (value) {\n // Show review prompt or related UI\n} else {\n // Fallback behavior for unsupported platforms\n}\n```"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "since",
|
|
24
|
+
"text": "8.0.0"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"docs": "Checks if the native In-App Review UI can be displayed.\nOn Android, it verifies Google Play Services availability.\nOn iOS, it checks the OS version compatibility.",
|
|
28
|
+
"complexTypes": [
|
|
29
|
+
"AvailabilityResult"
|
|
30
|
+
],
|
|
31
|
+
"slug": "isavailable"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "checkReviewEnvironment",
|
|
35
|
+
"signature": "() => Promise<ReviewEnvironmentResult>",
|
|
36
|
+
"parameters": [],
|
|
37
|
+
"returns": "Promise<ReviewEnvironmentResult>",
|
|
38
|
+
"tags": [
|
|
39
|
+
{
|
|
40
|
+
"name": "since",
|
|
41
|
+
"text": "8.0.0"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"docs": "Performs a diagnostic check to determine whether the\nGoogle Play In-App Review dialog can be displayed.\n\nThis does NOT trigger the review flow.\nAndroid-only. On other platforms, it resolves as unavailable.",
|
|
45
|
+
"complexTypes": [
|
|
46
|
+
"ReviewEnvironmentResult"
|
|
47
|
+
],
|
|
48
|
+
"slug": "checkreviewenvironment"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "requestReview",
|
|
52
|
+
"signature": "(options?: ReviewOptions | undefined) => Promise<void>",
|
|
53
|
+
"parameters": [
|
|
54
|
+
{
|
|
55
|
+
"name": "options",
|
|
56
|
+
"docs": "Optional review configuration overrides.",
|
|
57
|
+
"type": "ReviewOptions | undefined"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"returns": "Promise<void>",
|
|
61
|
+
"tags": [
|
|
62
|
+
{
|
|
63
|
+
"name": "param",
|
|
64
|
+
"text": "options Optional review configuration overrides."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "returns",
|
|
68
|
+
"text": "A promise that resolves when the request is sent or completed."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "example",
|
|
72
|
+
"text": "```ts\n// Basic usage with default configuration\nawait Rank.requestReview();\n\n// Usage with fire-and-forget behavior\nawait Rank.requestReview({ fireAndForget: true });\n```"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "since",
|
|
76
|
+
"text": "8.0.0"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"docs": "Requests the display of the native review popup.\nOn Web, this operation calls unimplemented().",
|
|
80
|
+
"complexTypes": [
|
|
81
|
+
"ReviewOptions"
|
|
82
|
+
],
|
|
83
|
+
"slug": "requestreview"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "presentProductPage",
|
|
87
|
+
"signature": "(options?: StoreOptions | undefined) => Promise<void>",
|
|
88
|
+
"parameters": [
|
|
89
|
+
{
|
|
90
|
+
"name": "options",
|
|
91
|
+
"docs": "Store identification.",
|
|
92
|
+
"type": "StoreOptions | undefined"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"returns": "Promise<void>",
|
|
96
|
+
"tags": [
|
|
97
|
+
{
|
|
98
|
+
"name": "param",
|
|
99
|
+
"text": "options Store identification."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "example",
|
|
103
|
+
"text": "```ts\n// On iOS, this will open an internal App Store overlay.\nawait Rank.presentProductPage({\n appId: '123456789' // iOS App ID for URL generation\n});\n\n// On Android, this will redirect to the Play Store.\nawait Rank.presentProductPage({\n packageName: 'com.example.app' // Android Package Name for URL generation\n});\n```"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "since",
|
|
107
|
+
"text": "8.0.0"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"docs": "Opens the App Store product page internally (iOS) or redirects to the Store (Android/Web).",
|
|
111
|
+
"complexTypes": [
|
|
112
|
+
"StoreOptions"
|
|
113
|
+
],
|
|
114
|
+
"slug": "presentproductpage"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "openStore",
|
|
118
|
+
"signature": "(options?: StoreOptions | undefined) => Promise<void>",
|
|
119
|
+
"parameters": [
|
|
120
|
+
{
|
|
121
|
+
"name": "options",
|
|
122
|
+
"docs": "Optional store identification overrides.",
|
|
123
|
+
"type": "StoreOptions | undefined"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"returns": "Promise<void>",
|
|
127
|
+
"tags": [
|
|
128
|
+
{
|
|
129
|
+
"name": "param",
|
|
130
|
+
"text": "options Optional store identification overrides."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "returns",
|
|
134
|
+
"text": "A promise that resolves when the store application is launched."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "example",
|
|
138
|
+
"text": "```ts\n// On Web, this will open the store page in a new tab if identifiers are provided.\nawait Rank.openStore({\n appId: '123456789', // iOS App ID for URL generation\n packageName: 'com.example.app' // Android Package Name for URL generation\n});\n```"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "since",
|
|
142
|
+
"text": "8.0.0"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"docs": "Opens the app's page in the App Store (iOS) or Play Store (Android).\nOn Web, it performs a URL redirect if parameters are provided.",
|
|
146
|
+
"complexTypes": [
|
|
147
|
+
"StoreOptions"
|
|
148
|
+
],
|
|
149
|
+
"slug": "openstore"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "openStoreListing",
|
|
153
|
+
"signature": "(options?: { appId?: string | undefined; } | undefined) => Promise<void>",
|
|
154
|
+
"parameters": [
|
|
155
|
+
{
|
|
156
|
+
"name": "options",
|
|
157
|
+
"docs": "",
|
|
158
|
+
"type": "{ appId?: string | undefined; } | undefined"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"returns": "Promise<void>",
|
|
162
|
+
"tags": [
|
|
163
|
+
{
|
|
164
|
+
"name": "example",
|
|
165
|
+
"text": "```ts\n// Opens the store listing page.\n// Uses the provided appId or falls back to the one in capacitor.config.ts\nawait Rank.openStoreListing({\n appId: '123456789'\n});\n```"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "since",
|
|
169
|
+
"text": "8.0.0"
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"docs": "Opens the App Store listing page for a specific app.\nIf no appId is provided, it uses the one from the plugin configuration.",
|
|
173
|
+
"complexTypes": [],
|
|
174
|
+
"slug": "openstorelisting"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "search",
|
|
178
|
+
"signature": "(options: { terms: string; }) => Promise<void>",
|
|
179
|
+
"parameters": [
|
|
180
|
+
{
|
|
181
|
+
"name": "options",
|
|
182
|
+
"docs": "",
|
|
183
|
+
"type": "{ terms: string; }"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"returns": "Promise<void>",
|
|
187
|
+
"tags": [
|
|
188
|
+
{
|
|
189
|
+
"name": "example",
|
|
190
|
+
"text": "```ts\n// Searches the store for specific terms.\n// Android: market://search | iOS: itms-apps search\nawait Rank.search({\n terms: 'Capacitor Plugins'\n});\n```"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "since",
|
|
194
|
+
"text": "8.0.0"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"docs": "Performs a search in the app store for the given terms.",
|
|
198
|
+
"complexTypes": [],
|
|
199
|
+
"slug": "search"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "openDevPage",
|
|
203
|
+
"signature": "(options: { devId: string; }) => Promise<void>",
|
|
204
|
+
"parameters": [
|
|
205
|
+
{
|
|
206
|
+
"name": "options",
|
|
207
|
+
"docs": "",
|
|
208
|
+
"type": "{ devId: string; }"
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"returns": "Promise<void>",
|
|
212
|
+
"tags": [
|
|
213
|
+
{
|
|
214
|
+
"name": "param",
|
|
215
|
+
"text": "options.devId On Android, this is the developer ID (numeric or string). On iOS, this is ignored."
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "example",
|
|
219
|
+
"text": "```ts\n// Navigates to a developer or brand page.\nawait Rank.openDevPage({\n devId: '543216789'\n});\n```"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": "since",
|
|
223
|
+
"text": "8.0.0"
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"docs": "Opens the developer's page in the app store.",
|
|
227
|
+
"complexTypes": [],
|
|
228
|
+
"slug": "opendevpage"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "openCollection",
|
|
232
|
+
"signature": "(options: { name: string; }) => Promise<void>",
|
|
233
|
+
"parameters": [
|
|
234
|
+
{
|
|
235
|
+
"name": "options",
|
|
236
|
+
"docs": "",
|
|
237
|
+
"type": "{ name: string; }"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"returns": "Promise<void>",
|
|
241
|
+
"tags": [
|
|
242
|
+
{
|
|
243
|
+
"name": "example",
|
|
244
|
+
"text": "```ts\n// Opens a curated collection (Android only).\nawait Rank.openCollection({\n name: 'editors_choice'\n});\n```"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "since",
|
|
248
|
+
"text": "8.0.0"
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"docs": "Opens a specific app collection (Android Only).",
|
|
252
|
+
"complexTypes": [],
|
|
253
|
+
"slug": "opencollection"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "getPluginVersion",
|
|
257
|
+
"signature": "() => Promise<PluginVersionResult>",
|
|
258
|
+
"parameters": [],
|
|
259
|
+
"returns": "Promise<PluginVersionResult>",
|
|
260
|
+
"tags": [
|
|
261
|
+
{
|
|
262
|
+
"name": "returns",
|
|
263
|
+
"text": "A promise resolving to the plugin version."
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "example",
|
|
267
|
+
"text": "```ts\nconst { version } = await Rank.getPluginVersion();\n```"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "since",
|
|
271
|
+
"text": "8.0.0"
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
"docs": "Returns the native plugin version.\n\nThe returned version corresponds to the native implementation\nbundled with the application.",
|
|
275
|
+
"complexTypes": [
|
|
276
|
+
"PluginVersionResult"
|
|
277
|
+
],
|
|
278
|
+
"slug": "getpluginversion"
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"properties": []
|
|
282
|
+
},
|
|
283
|
+
"interfaces": [
|
|
284
|
+
{
|
|
285
|
+
"name": "AvailabilityResult",
|
|
286
|
+
"slug": "availabilityresult",
|
|
287
|
+
"docs": "Result object returned by the `isAvailable()` method.",
|
|
288
|
+
"tags": [],
|
|
289
|
+
"methods": [],
|
|
290
|
+
"properties": [
|
|
291
|
+
{
|
|
292
|
+
"name": "value",
|
|
293
|
+
"tags": [],
|
|
294
|
+
"docs": "Indicates whether the native In-App Review UI is available.",
|
|
295
|
+
"complexTypes": [],
|
|
296
|
+
"type": "boolean"
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "ReviewEnvironmentResult",
|
|
302
|
+
"slug": "reviewenvironmentresult",
|
|
303
|
+
"docs": "Diagnostic result for Android In-App Review availability.\n\nThis result describes whether the Google Play Review\nflow can actually be displayed in the current environment.",
|
|
304
|
+
"tags": [
|
|
305
|
+
{
|
|
306
|
+
"text": "8.0.0",
|
|
307
|
+
"name": "since"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"methods": [],
|
|
311
|
+
"properties": [
|
|
312
|
+
{
|
|
313
|
+
"name": "canRequestReview",
|
|
314
|
+
"tags": [],
|
|
315
|
+
"docs": "True if the environment supports showing the review dialog.",
|
|
316
|
+
"complexTypes": [],
|
|
317
|
+
"type": "boolean"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "reason",
|
|
321
|
+
"tags": [],
|
|
322
|
+
"docs": "Optional diagnostic reason when the review dialog cannot be shown.",
|
|
323
|
+
"complexTypes": [],
|
|
324
|
+
"type": "'PLAY_STORE_NOT_AVAILABLE' | 'NOT_INSTALLED_FROM_PLAY_STORE' | undefined"
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "ReviewOptions",
|
|
330
|
+
"slug": "reviewoptions",
|
|
331
|
+
"docs": "Options for the `requestReview` method.",
|
|
332
|
+
"tags": [],
|
|
333
|
+
"methods": [],
|
|
334
|
+
"properties": [
|
|
335
|
+
{
|
|
336
|
+
"name": "fireAndForget",
|
|
337
|
+
"tags": [],
|
|
338
|
+
"docs": "Override the global configuration to determine if the promise\nshould resolve immediately or wait for the native flow.",
|
|
339
|
+
"complexTypes": [],
|
|
340
|
+
"type": "boolean | undefined"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "StoreOptions",
|
|
346
|
+
"slug": "storeoptions",
|
|
347
|
+
"docs": "Options for the `openStore` method.",
|
|
348
|
+
"tags": [],
|
|
349
|
+
"methods": [],
|
|
350
|
+
"properties": [
|
|
351
|
+
{
|
|
352
|
+
"name": "appId",
|
|
353
|
+
"tags": [],
|
|
354
|
+
"docs": "Runtime override for the Apple App ID on iOS.",
|
|
355
|
+
"complexTypes": [],
|
|
356
|
+
"type": "string | undefined"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "packageName",
|
|
360
|
+
"tags": [],
|
|
361
|
+
"docs": "Runtime override for the Android Package Name.",
|
|
362
|
+
"complexTypes": [],
|
|
363
|
+
"type": "string | undefined"
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "PluginVersionResult",
|
|
369
|
+
"slug": "pluginversionresult",
|
|
370
|
+
"docs": "Result object returned by the `getPluginVersion()` method.",
|
|
371
|
+
"tags": [],
|
|
372
|
+
"methods": [],
|
|
373
|
+
"properties": [
|
|
374
|
+
{
|
|
375
|
+
"name": "version",
|
|
376
|
+
"tags": [],
|
|
377
|
+
"docs": "The native plugin version string.",
|
|
378
|
+
"complexTypes": [],
|
|
379
|
+
"type": "string"
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
"enums": [],
|
|
385
|
+
"typeAliases": [],
|
|
386
|
+
"pluginConfigs": [
|
|
387
|
+
{
|
|
388
|
+
"name": "Rank",
|
|
389
|
+
"slug": "rank",
|
|
390
|
+
"properties": [
|
|
391
|
+
{
|
|
392
|
+
"name": "verboseLogging",
|
|
393
|
+
"tags": [
|
|
394
|
+
{
|
|
395
|
+
"text": "false",
|
|
396
|
+
"name": "default"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"text": "true",
|
|
400
|
+
"name": "example"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"text": "8.0.0",
|
|
404
|
+
"name": "since"
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"docs": "Enables verbose native logging.\n\nWhen enabled, additional debug information is printed\nto the native console (Logcat on Android, Xcode on iOS).",
|
|
408
|
+
"complexTypes": [],
|
|
409
|
+
"type": "boolean | undefined"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "appleAppId",
|
|
413
|
+
"tags": [],
|
|
414
|
+
"docs": "The Apple App ID used for App Store redirection on iOS.\nExample: '123456789'\n* @since 8.0.0",
|
|
415
|
+
"complexTypes": [],
|
|
416
|
+
"type": "string | undefined"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"name": "androidPackageName",
|
|
420
|
+
"tags": [],
|
|
421
|
+
"docs": "The Android Package Name used for Play Store redirection.\nExample: 'com.example.app'\n* @since 8.0.0",
|
|
422
|
+
"complexTypes": [],
|
|
423
|
+
"type": "string | undefined"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "fireAndForget",
|
|
427
|
+
"tags": [
|
|
428
|
+
{
|
|
429
|
+
"text": "8.0.0",
|
|
430
|
+
"name": "since"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"docs": "If true, the `requestReview` method will resolve immediately\nwithout waiting for the native OS review flow to complete.\n* @default false",
|
|
434
|
+
"complexTypes": [],
|
|
435
|
+
"type": "boolean | undefined"
|
|
436
|
+
}
|
|
437
|
+
],
|
|
438
|
+
"docs": "Configuration options for the Rank plugin."
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
}
|