@capgo/native-market 7.1.21 → 7.2.3
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 +40 -26
- package/android/src/main/java/com/getcapacitor/community/nativemarket/NativeMarket.java +14 -0
- package/dist/docs.json +97 -25
- package/dist/esm/definitions.d.ts +82 -31
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NativeMarketPlugin/NativeMarketPlugin.swift +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,17 +111,19 @@ NativeMarket.search({
|
|
|
111
111
|
<docgen-api>
|
|
112
112
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
113
113
|
|
|
114
|
+
Capacitor Native Market Plugin for opening app store listings and pages.
|
|
115
|
+
|
|
114
116
|
### openStoreListing(...)
|
|
115
117
|
|
|
116
118
|
```typescript
|
|
117
119
|
openStoreListing(options: { appId: string; country?: string; }) => Promise<void>
|
|
118
120
|
```
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
Launch app listing page in Play Store (Android) or App Store (iOS).
|
|
121
123
|
|
|
122
|
-
| Param | Type |
|
|
123
|
-
| ------------- | ------------------------------------------------- |
|
|
124
|
-
| **`options`** | <code>{ appId: string; country?: string; }</code> |
|
|
124
|
+
| Param | Type | Description |
|
|
125
|
+
| ------------- | ------------------------------------------------- | --------------------------------------------- |
|
|
126
|
+
| **`options`** | <code>{ appId: string; country?: string; }</code> | - Configuration for opening the store listing |
|
|
125
127
|
|
|
126
128
|
**Since:** 1.0.0
|
|
127
129
|
|
|
@@ -134,13 +136,12 @@ This method will launch link in Play/App Store.
|
|
|
134
136
|
openDevPage(options: { devId: string; }) => Promise<void>
|
|
135
137
|
```
|
|
136
138
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Only in Android.
|
|
139
|
+
Deep-link directly to a developer's page in the Play Store.
|
|
140
|
+
Android only.
|
|
140
141
|
|
|
141
|
-
| Param | Type |
|
|
142
|
-
| ------------- | ------------------------------- |
|
|
143
|
-
| **`options`** | <code>{ devId: string; }</code> |
|
|
142
|
+
| Param | Type | Description |
|
|
143
|
+
| ------------- | ------------------------------- | --------------------------------- |
|
|
144
|
+
| **`options`** | <code>{ devId: string; }</code> | - Configuration with developer ID |
|
|
144
145
|
|
|
145
146
|
**Since:** 1.0.0
|
|
146
147
|
|
|
@@ -153,12 +154,12 @@ Only in Android.
|
|
|
153
154
|
openCollection(options: { name: string; }) => Promise<void>
|
|
154
155
|
```
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
Link users to a collection or top charts in the Play Store.
|
|
158
|
+
Android only.
|
|
158
159
|
|
|
159
|
-
| Param | Type |
|
|
160
|
-
| ------------- | ------------------------------ |
|
|
161
|
-
| **`options`** | <code>{ name: string; }</code> |
|
|
160
|
+
| Param | Type | Description |
|
|
161
|
+
| ------------- | ------------------------------ | ------------------------------------ |
|
|
162
|
+
| **`options`** | <code>{ name: string; }</code> | - Configuration with collection name |
|
|
162
163
|
|
|
163
164
|
**Since:** 1.0.0
|
|
164
165
|
|
|
@@ -171,13 +172,12 @@ Only in Android.
|
|
|
171
172
|
openEditorChoicePage(options: { editorChoice: string; }) => Promise<void>
|
|
172
173
|
```
|
|
173
174
|
|
|
174
|
-
|
|
175
|
+
Link users to Editor's choice page in the Play Store.
|
|
176
|
+
Android only.
|
|
175
177
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
|
179
|
-
| ------------- | -------------------------------------- |
|
|
180
|
-
| **`options`** | <code>{ editorChoice: string; }</code> |
|
|
178
|
+
| Param | Type | Description |
|
|
179
|
+
| ------------- | -------------------------------------- | ------------------------------------- |
|
|
180
|
+
| **`options`** | <code>{ editorChoice: string; }</code> | - Configuration with editor choice ID |
|
|
181
181
|
|
|
182
182
|
**Since:** 1.0.0
|
|
183
183
|
|
|
@@ -190,13 +190,27 @@ Only in Android.
|
|
|
190
190
|
search(options: { terms: string; }) => Promise<void>
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
Search the Play Store with custom search terms.
|
|
194
|
+
Android only.
|
|
195
|
+
|
|
196
|
+
| Param | Type | Description |
|
|
197
|
+
| ------------- | ------------------------------- | --------------------------------- |
|
|
198
|
+
| **`options`** | <code>{ terms: string; }</code> | - Configuration with search terms |
|
|
199
|
+
|
|
200
|
+
**Since:** 1.0.0
|
|
201
|
+
|
|
202
|
+
--------------------
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
### getPluginVersion()
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
getPluginVersion() => Promise<{ version: string; }>
|
|
209
|
+
```
|
|
194
210
|
|
|
195
|
-
|
|
211
|
+
Get the native Capacitor plugin version.
|
|
196
212
|
|
|
197
|
-
|
|
198
|
-
| ------------- | ------------------------------- |
|
|
199
|
-
| **`options`** | <code>{ terms: string; }</code> |
|
|
213
|
+
**Returns:** <code>Promise<{ version: string; }></code>
|
|
200
214
|
|
|
201
215
|
**Since:** 1.0.0
|
|
202
216
|
|
|
@@ -3,6 +3,7 @@ package com.getcapacitor.community.nativemarket;
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.content.Intent;
|
|
5
5
|
import android.net.Uri;
|
|
6
|
+
import com.getcapacitor.JSObject;
|
|
6
7
|
import com.getcapacitor.Plugin;
|
|
7
8
|
import com.getcapacitor.PluginCall;
|
|
8
9
|
import com.getcapacitor.PluginMethod;
|
|
@@ -11,6 +12,8 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
11
12
|
@CapacitorPlugin(name = "NativeMarket")
|
|
12
13
|
public class NativeMarket extends Plugin {
|
|
13
14
|
|
|
15
|
+
private final String PLUGIN_VERSION = "";
|
|
16
|
+
|
|
14
17
|
@PluginMethod
|
|
15
18
|
public void openStoreListing(PluginCall call) {
|
|
16
19
|
try {
|
|
@@ -113,4 +116,15 @@ public class NativeMarket extends Plugin {
|
|
|
113
116
|
call.reject(ex.getLocalizedMessage());
|
|
114
117
|
}
|
|
115
118
|
}
|
|
119
|
+
|
|
120
|
+
@PluginMethod
|
|
121
|
+
public void getPluginVersion(final PluginCall call) {
|
|
122
|
+
try {
|
|
123
|
+
final JSObject ret = new JSObject();
|
|
124
|
+
ret.put("version", this.PLUGIN_VERSION);
|
|
125
|
+
call.resolve(ret);
|
|
126
|
+
} catch (final Exception e) {
|
|
127
|
+
call.reject("Could not get plugin version", e);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
116
130
|
}
|
package/dist/docs.json
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
"api": {
|
|
3
3
|
"name": "NativeMarketPlugin",
|
|
4
4
|
"slug": "nativemarketplugin",
|
|
5
|
-
"docs": "",
|
|
6
|
-
"tags": [
|
|
5
|
+
"docs": "Capacitor Native Market Plugin for opening app store listings and pages.",
|
|
6
|
+
"tags": [
|
|
7
|
+
{
|
|
8
|
+
"text": "1.0.0",
|
|
9
|
+
"name": "since"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
7
12
|
"methods": [
|
|
8
13
|
{
|
|
9
14
|
"name": "openStoreListing",
|
|
@@ -11,7 +16,7 @@
|
|
|
11
16
|
"parameters": [
|
|
12
17
|
{
|
|
13
18
|
"name": "options",
|
|
14
|
-
"docs": "",
|
|
19
|
+
"docs": "- Configuration for opening the store listing",
|
|
15
20
|
"type": "{ appId: string; country?: string | undefined; }"
|
|
16
21
|
}
|
|
17
22
|
],
|
|
@@ -19,22 +24,26 @@
|
|
|
19
24
|
"tags": [
|
|
20
25
|
{
|
|
21
26
|
"name": "param",
|
|
22
|
-
"text": "
|
|
27
|
+
"text": "options - Configuration for opening the store listing"
|
|
23
28
|
},
|
|
24
29
|
{
|
|
25
|
-
"name": "
|
|
26
|
-
"text": "
|
|
30
|
+
"name": "returns",
|
|
31
|
+
"text": "Promise that resolves when the store is opened"
|
|
27
32
|
},
|
|
28
33
|
{
|
|
29
|
-
"name": "
|
|
30
|
-
"text": "
|
|
34
|
+
"name": "throws",
|
|
35
|
+
"text": "Error if opening the store fails"
|
|
31
36
|
},
|
|
32
37
|
{
|
|
33
38
|
"name": "since",
|
|
34
39
|
"text": "1.0.0"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "example",
|
|
43
|
+
"text": "```typescript\n// Open app in store\nawait NativeMarket.openStoreListing({\n appId: 'com.example.app'\n});\n\n// Open app in specific country store (iOS only)\nawait NativeMarket.openStoreListing({\n appId: 'com.example.app',\n country: 'IT'\n});\n```"
|
|
35
44
|
}
|
|
36
45
|
],
|
|
37
|
-
"docs": "
|
|
46
|
+
"docs": "Launch app listing page in Play Store (Android) or App Store (iOS).",
|
|
38
47
|
"complexTypes": [],
|
|
39
48
|
"slug": "openstorelisting"
|
|
40
49
|
},
|
|
@@ -44,7 +53,7 @@
|
|
|
44
53
|
"parameters": [
|
|
45
54
|
{
|
|
46
55
|
"name": "options",
|
|
47
|
-
"docs": "",
|
|
56
|
+
"docs": "- Configuration with developer ID",
|
|
48
57
|
"type": "{ devId: string; }"
|
|
49
58
|
}
|
|
50
59
|
],
|
|
@@ -52,18 +61,26 @@
|
|
|
52
61
|
"tags": [
|
|
53
62
|
{
|
|
54
63
|
"name": "param",
|
|
55
|
-
"text": "
|
|
64
|
+
"text": "options - Configuration with developer ID"
|
|
56
65
|
},
|
|
57
66
|
{
|
|
58
67
|
"name": "returns",
|
|
59
|
-
"text": "
|
|
68
|
+
"text": "Promise that resolves when the page is opened"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "throws",
|
|
72
|
+
"text": "Error if opening the page fails or if called on iOS"
|
|
60
73
|
},
|
|
61
74
|
{
|
|
62
75
|
"name": "since",
|
|
63
76
|
"text": "1.0.0"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "example",
|
|
80
|
+
"text": "```typescript\nawait NativeMarket.openDevPage({\n devId: 'Google+LLC'\n});\n```"
|
|
64
81
|
}
|
|
65
82
|
],
|
|
66
|
-
"docs": "
|
|
83
|
+
"docs": "Deep-link directly to a developer's page in the Play Store.\nAndroid only.",
|
|
67
84
|
"complexTypes": [],
|
|
68
85
|
"slug": "opendevpage"
|
|
69
86
|
},
|
|
@@ -73,7 +90,7 @@
|
|
|
73
90
|
"parameters": [
|
|
74
91
|
{
|
|
75
92
|
"name": "options",
|
|
76
|
-
"docs": "",
|
|
93
|
+
"docs": "- Configuration with collection name",
|
|
77
94
|
"type": "{ name: string; }"
|
|
78
95
|
}
|
|
79
96
|
],
|
|
@@ -81,18 +98,30 @@
|
|
|
81
98
|
"tags": [
|
|
82
99
|
{
|
|
83
100
|
"name": "param",
|
|
84
|
-
"text": "
|
|
101
|
+
"text": "options - Configuration with collection name"
|
|
85
102
|
},
|
|
86
103
|
{
|
|
87
104
|
"name": "returns",
|
|
88
|
-
"text": "
|
|
105
|
+
"text": "Promise that resolves when the collection is opened"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "throws",
|
|
109
|
+
"text": "Error if opening the collection fails or if called on iOS"
|
|
89
110
|
},
|
|
90
111
|
{
|
|
91
112
|
"name": "since",
|
|
92
113
|
"text": "1.0.0"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "example",
|
|
117
|
+
"text": "```typescript\nawait NativeMarket.openCollection({\n name: 'featured'\n});\n```"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "see",
|
|
121
|
+
"text": "https ://developer.android.com/distribute/marketing-tools/linking-to-google-play#OpeningCollection"
|
|
93
122
|
}
|
|
94
123
|
],
|
|
95
|
-
"docs": "
|
|
124
|
+
"docs": "Link users to a collection or top charts in the Play Store.\nAndroid only.",
|
|
96
125
|
"complexTypes": [],
|
|
97
126
|
"slug": "opencollection"
|
|
98
127
|
},
|
|
@@ -102,7 +131,7 @@
|
|
|
102
131
|
"parameters": [
|
|
103
132
|
{
|
|
104
133
|
"name": "options",
|
|
105
|
-
"docs": "",
|
|
134
|
+
"docs": "- Configuration with editor choice ID",
|
|
106
135
|
"type": "{ editorChoice: string; }"
|
|
107
136
|
}
|
|
108
137
|
],
|
|
@@ -110,18 +139,26 @@
|
|
|
110
139
|
"tags": [
|
|
111
140
|
{
|
|
112
141
|
"name": "param",
|
|
113
|
-
"text": "
|
|
142
|
+
"text": "options - Configuration with editor choice ID"
|
|
114
143
|
},
|
|
115
144
|
{
|
|
116
145
|
"name": "returns",
|
|
117
|
-
"text": "
|
|
146
|
+
"text": "Promise that resolves when the page is opened"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "throws",
|
|
150
|
+
"text": "Error if opening the page fails or if called on iOS"
|
|
118
151
|
},
|
|
119
152
|
{
|
|
120
153
|
"name": "since",
|
|
121
154
|
"text": "1.0.0"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "example",
|
|
158
|
+
"text": "```typescript\nawait NativeMarket.openEditorChoicePage({\n editorChoice: 'editorial_fitness_apps_us'\n});\n```"
|
|
122
159
|
}
|
|
123
160
|
],
|
|
124
|
-
"docs": "
|
|
161
|
+
"docs": "Link users to Editor's choice page in the Play Store.\nAndroid only.",
|
|
125
162
|
"complexTypes": [],
|
|
126
163
|
"slug": "openeditorchoicepage"
|
|
127
164
|
},
|
|
@@ -131,7 +168,7 @@
|
|
|
131
168
|
"parameters": [
|
|
132
169
|
{
|
|
133
170
|
"name": "options",
|
|
134
|
-
"docs": "",
|
|
171
|
+
"docs": "- Configuration with search terms",
|
|
135
172
|
"type": "{ terms: string; }"
|
|
136
173
|
}
|
|
137
174
|
],
|
|
@@ -139,20 +176,55 @@
|
|
|
139
176
|
"tags": [
|
|
140
177
|
{
|
|
141
178
|
"name": "param",
|
|
142
|
-
"text": "
|
|
179
|
+
"text": "options - Configuration with search terms"
|
|
143
180
|
},
|
|
144
181
|
{
|
|
145
182
|
"name": "returns",
|
|
146
|
-
"text": "
|
|
183
|
+
"text": "Promise that resolves when the search is opened"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "throws",
|
|
187
|
+
"text": "Error if opening search fails or if called on iOS"
|
|
147
188
|
},
|
|
148
189
|
{
|
|
149
190
|
"name": "since",
|
|
150
191
|
"text": "1.0.0"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "example",
|
|
195
|
+
"text": "```typescript\nawait NativeMarket.search({\n terms: 'fitness apps'\n});\n```"
|
|
151
196
|
}
|
|
152
197
|
],
|
|
153
|
-
"docs": "
|
|
198
|
+
"docs": "Search the Play Store with custom search terms.\nAndroid only.",
|
|
154
199
|
"complexTypes": [],
|
|
155
200
|
"slug": "search"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "getPluginVersion",
|
|
204
|
+
"signature": "() => Promise<{ version: string; }>",
|
|
205
|
+
"parameters": [],
|
|
206
|
+
"returns": "Promise<{ version: string; }>",
|
|
207
|
+
"tags": [
|
|
208
|
+
{
|
|
209
|
+
"name": "returns",
|
|
210
|
+
"text": "Promise that resolves with the plugin version"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "throws",
|
|
214
|
+
"text": "Error if getting the version fails"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "since",
|
|
218
|
+
"text": "1.0.0"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "example",
|
|
222
|
+
"text": "```typescript\nconst { version } = await NativeMarket.getPluginVersion();\nconsole.log('Plugin version:', version);\n```"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"docs": "Get the native Capacitor plugin version.",
|
|
226
|
+
"complexTypes": [],
|
|
227
|
+
"slug": "getpluginversion"
|
|
156
228
|
}
|
|
157
229
|
],
|
|
158
230
|
"properties": []
|
|
@@ -1,69 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacitor Native Market Plugin for opening app store listings and pages.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
1
6
|
export interface NativeMarketPlugin {
|
|
2
7
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @param {String} appId - ID of your application. Eg. com.example.app
|
|
6
|
-
* @param {String} [country] - International country code if application is not published in the US App store (only for iOS). Eg. IT
|
|
7
|
-
*
|
|
8
|
-
* @returns void
|
|
8
|
+
* Launch app listing page in Play Store (Android) or App Store (iOS).
|
|
9
9
|
*
|
|
10
|
+
* @param options - Configuration for opening the store listing
|
|
11
|
+
* @returns Promise that resolves when the store is opened
|
|
12
|
+
* @throws Error if opening the store fails
|
|
10
13
|
* @since 1.0.0
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Open app in store
|
|
17
|
+
* await NativeMarket.openStoreListing({
|
|
18
|
+
* appId: 'com.example.app'
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Open app in specific country store (iOS only)
|
|
22
|
+
* await NativeMarket.openStoreListing({
|
|
23
|
+
* appId: 'com.example.app',
|
|
24
|
+
* country: 'IT'
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
11
27
|
*/
|
|
12
28
|
openStoreListing(options: {
|
|
13
29
|
appId: string;
|
|
14
30
|
country?: string;
|
|
15
31
|
}): Promise<void>;
|
|
16
32
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* Only in Android.
|
|
20
|
-
*
|
|
21
|
-
* @param {String} devId - ID of developer. Eg. com.example.app
|
|
22
|
-
*
|
|
23
|
-
* @returns void
|
|
33
|
+
* Deep-link directly to a developer's page in the Play Store.
|
|
34
|
+
* Android only.
|
|
24
35
|
*
|
|
36
|
+
* @param options - Configuration with developer ID
|
|
37
|
+
* @returns Promise that resolves when the page is opened
|
|
38
|
+
* @throws Error if opening the page fails or if called on iOS
|
|
25
39
|
* @since 1.0.0
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* await NativeMarket.openDevPage({
|
|
43
|
+
* devId: 'Google+LLC'
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
26
46
|
*/
|
|
27
47
|
openDevPage(options: {
|
|
28
48
|
devId: string;
|
|
29
49
|
}): Promise<void>;
|
|
30
50
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @param {String} name - name of the collection. Click [here](https://developer.android.com/distribute/marketing-tools/linking-to-google-play#OpeningCollection) for android options.
|
|
35
|
-
*
|
|
36
|
-
* @returns void
|
|
51
|
+
* Link users to a collection or top charts in the Play Store.
|
|
52
|
+
* Android only.
|
|
37
53
|
*
|
|
54
|
+
* @param options - Configuration with collection name
|
|
55
|
+
* @returns Promise that resolves when the collection is opened
|
|
56
|
+
* @throws Error if opening the collection fails or if called on iOS
|
|
38
57
|
* @since 1.0.0
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* await NativeMarket.openCollection({
|
|
61
|
+
* name: 'featured'
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
* @see https://developer.android.com/distribute/marketing-tools/linking-to-google-play#OpeningCollection
|
|
39
65
|
*/
|
|
40
66
|
openCollection(options: {
|
|
41
67
|
name: string;
|
|
42
68
|
}): Promise<void>;
|
|
43
69
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* Only in Android.
|
|
47
|
-
*
|
|
48
|
-
* @param {String} editorChoice - ID of your application. Eg. editorial_fitness_apps_us
|
|
49
|
-
* @returns void
|
|
70
|
+
* Link users to Editor's choice page in the Play Store.
|
|
71
|
+
* Android only.
|
|
50
72
|
*
|
|
73
|
+
* @param options - Configuration with editor choice ID
|
|
74
|
+
* @returns Promise that resolves when the page is opened
|
|
75
|
+
* @throws Error if opening the page fails or if called on iOS
|
|
51
76
|
* @since 1.0.0
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* await NativeMarket.openEditorChoicePage({
|
|
80
|
+
* editorChoice: 'editorial_fitness_apps_us'
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
52
83
|
*/
|
|
53
84
|
openEditorChoicePage(options: {
|
|
54
85
|
editorChoice: string;
|
|
55
86
|
}): Promise<void>;
|
|
56
87
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* Only in Android.
|
|
60
|
-
*
|
|
61
|
-
* @param {String} editorChoice - terms to be searched in Play/App store.
|
|
62
|
-
* @returns void
|
|
88
|
+
* Search the Play Store with custom search terms.
|
|
89
|
+
* Android only.
|
|
63
90
|
*
|
|
91
|
+
* @param options - Configuration with search terms
|
|
92
|
+
* @returns Promise that resolves when the search is opened
|
|
93
|
+
* @throws Error if opening search fails or if called on iOS
|
|
64
94
|
* @since 1.0.0
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* await NativeMarket.search({
|
|
98
|
+
* terms: 'fitness apps'
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
65
101
|
*/
|
|
66
102
|
search(options: {
|
|
67
103
|
terms: string;
|
|
68
104
|
}): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Get the native Capacitor plugin version.
|
|
107
|
+
*
|
|
108
|
+
* @returns Promise that resolves with the plugin version
|
|
109
|
+
* @throws Error if getting the version fails
|
|
110
|
+
* @since 1.0.0
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const { version } = await NativeMarket.getPluginVersion();
|
|
114
|
+
* console.log('Plugin version:', version);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
getPluginVersion(): Promise<{
|
|
118
|
+
version: string;
|
|
119
|
+
}>;
|
|
69
120
|
}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
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;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,gBAAgB,CAAC,OAA4C;QAC3D,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,WAAW,CAAC,OAA0B;QACpC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,cAAc,CAAC,OAAyB;QACtC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,oBAAoB,CAAC,OAAiC;QACpD,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,OAA0B;QAC/B,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,gBAAgB,CAAC,OAA4C;QAC3D,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,WAAW,CAAC,OAA0B;QACpC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,cAAc,CAAC,OAAyB;QACtC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,oBAAoB,CAAC,OAAiC;QACpD,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,OAA0B;QAC/B,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst NativeMarket = registerPlugin('NativeMarket', {\n web: () => import('./web').then((m) => new m.NativeMarketWeb()),\n});\nexport * from './definitions';\nexport { NativeMarket };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeMarketWeb extends WebPlugin {\n openStoreListing(options) {\n throw new Error('Method not implemented.' + options);\n }\n openDevPage(options) {\n throw new Error('Method not implemented.' + options);\n }\n openCollection(options) {\n throw new Error('Method not implemented.' + options);\n }\n openEditorChoicePage(options) {\n throw new Error('Method not implemented.' + options);\n }\n search(options) {\n throw new Error('Method not implemented.' + options);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,gBAAgB,CAAC,OAAO,EAAE;AAC9B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,cAAc,CAAC,OAAO,EAAE;AAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,oBAAoB,CAAC,OAAO,EAAE;AAClC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,MAAM,CAAC,OAAO,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst NativeMarket = registerPlugin('NativeMarket', {\n web: () => import('./web').then((m) => new m.NativeMarketWeb()),\n});\nexport * from './definitions';\nexport { NativeMarket };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeMarketWeb extends WebPlugin {\n openStoreListing(options) {\n throw new Error('Method not implemented.' + options);\n }\n openDevPage(options) {\n throw new Error('Method not implemented.' + options);\n }\n openCollection(options) {\n throw new Error('Method not implemented.' + options);\n }\n openEditorChoicePage(options) {\n throw new Error('Method not implemented.' + options);\n }\n search(options) {\n throw new Error('Method not implemented.' + options);\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,gBAAgB,CAAC,OAAO,EAAE;AAC9B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,cAAc,CAAC,OAAO,EAAE;AAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,oBAAoB,CAAC,OAAO,EAAE;AAClC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,MAAM,CAAC,OAAO,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst NativeMarket = registerPlugin('NativeMarket', {\n web: () => import('./web').then((m) => new m.NativeMarketWeb()),\n});\nexport * from './definitions';\nexport { NativeMarket };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeMarketWeb extends WebPlugin {\n openStoreListing(options) {\n throw new Error('Method not implemented.' + options);\n }\n openDevPage(options) {\n throw new Error('Method not implemented.' + options);\n }\n openCollection(options) {\n throw new Error('Method not implemented.' + options);\n }\n openEditorChoicePage(options) {\n throw new Error('Method not implemented.' + options);\n }\n search(options) {\n throw new Error('Method not implemented.' + options);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,gBAAgB,CAAC,OAAO,EAAE;IAC9B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,WAAW,CAAC,OAAO,EAAE;IACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,cAAc,CAAC,OAAO,EAAE;IAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,oBAAoB,CAAC,OAAO,EAAE;IAClC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,MAAM,CAAC,OAAO,EAAE;IACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst NativeMarket = registerPlugin('NativeMarket', {\n web: () => import('./web').then((m) => new m.NativeMarketWeb()),\n});\nexport * from './definitions';\nexport { NativeMarket };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeMarketWeb extends WebPlugin {\n openStoreListing(options) {\n throw new Error('Method not implemented.' + options);\n }\n openDevPage(options) {\n throw new Error('Method not implemented.' + options);\n }\n openCollection(options) {\n throw new Error('Method not implemented.' + options);\n }\n openEditorChoicePage(options) {\n throw new Error('Method not implemented.' + options);\n }\n search(options) {\n throw new Error('Method not implemented.' + options);\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,gBAAgB,CAAC,OAAO,EAAE;IAC9B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,WAAW,CAAC,OAAO,EAAE;IACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,cAAc,CAAC,OAAO,EAAE;IAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,oBAAoB,CAAC,OAAO,EAAE;IAClC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,MAAM,CAAC,OAAO,EAAE;IACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -25,6 +25,7 @@ struct APIResult: Codable {
|
|
|
25
25
|
*/
|
|
26
26
|
@objc(NativeMarket)
|
|
27
27
|
public class NativeMarket: CAPPlugin, CAPBridgedPlugin {
|
|
28
|
+
private let PLUGIN_VERSION: String = "7.2.3"
|
|
28
29
|
public let identifier = "NativeMarketPlugin"
|
|
29
30
|
public let jsName = "NativeMarket"
|
|
30
31
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -32,7 +33,8 @@ public class NativeMarket: CAPPlugin, CAPBridgedPlugin {
|
|
|
32
33
|
CAPPluginMethod(name: "openDevPage", returnType: CAPPluginReturnPromise),
|
|
33
34
|
CAPPluginMethod(name: "openCollection", returnType: CAPPluginReturnPromise),
|
|
34
35
|
CAPPluginMethod(name: "openEditorChoicePage", returnType: CAPPluginReturnPromise),
|
|
35
|
-
CAPPluginMethod(name: "search", returnType: CAPPluginReturnPromise)
|
|
36
|
+
CAPPluginMethod(name: "search", returnType: CAPPluginReturnPromise),
|
|
37
|
+
CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
|
|
36
38
|
]
|
|
37
39
|
@objc func openStoreListing(_ call: CAPPluginCall) {
|
|
38
40
|
guard let appId = call.getString("appId") else {
|
|
@@ -110,4 +112,9 @@ public class NativeMarket: CAPPlugin, CAPBridgedPlugin {
|
|
|
110
112
|
call.reject("terms is missing")
|
|
111
113
|
}
|
|
112
114
|
}
|
|
115
|
+
|
|
116
|
+
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
117
|
+
call.resolve(["version": self.PLUGIN_VERSION])
|
|
118
|
+
}
|
|
119
|
+
|
|
113
120
|
}
|