@capgo/capacitor-native-market 8.0.29
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/CapgoCapacitorNativeMarket.podspec +17 -0
- package/LICENSE +373 -0
- package/Package.swift +28 -0
- package/README.md +262 -0
- package/android/build.gradle +56 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/getcapacitor/community/nativemarket/NativeMarket.java +130 -0
- package/dist/docs.json +236 -0
- package/dist/esm/definitions.d.ts +120 -0
- package/dist/esm/definitions.js +2 -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 +23 -0
- package/dist/esm/web.js +22 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +36 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +39 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/NativeMarketPlugin/NativeMarketPlugin.swift +110 -0
- package/ios/Tests/NativeMarketPluginTests/NativeMarketPluginTests.swift +20 -0
- package/package.json +88 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
mavenCentral()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
|
+
android {
|
|
21
|
+
namespace = "com.getcapacitor.community.nativemarket.nativemarket"
|
|
22
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
23
|
+
defaultConfig {
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
26
|
+
versionCode 1
|
|
27
|
+
versionName "1.0"
|
|
28
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
29
|
+
}
|
|
30
|
+
buildTypes {
|
|
31
|
+
release {
|
|
32
|
+
minifyEnabled false
|
|
33
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lintOptions {
|
|
37
|
+
abortOnError = false
|
|
38
|
+
disable "UnsafeExperimentalUsageError",
|
|
39
|
+
"UnsafeExperimentalUsageWarning"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
repositories {
|
|
44
|
+
google()
|
|
45
|
+
mavenCentral()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
dependencies {
|
|
50
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
51
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
52
|
+
implementation project(':capacitor-android')
|
|
53
|
+
testImplementation "junit:junit:$junitVersion"
|
|
54
|
+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
55
|
+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
56
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
package com.getcapacitor.community.nativemarket;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.net.Uri;
|
|
6
|
+
import com.getcapacitor.JSObject;
|
|
7
|
+
import com.getcapacitor.Plugin;
|
|
8
|
+
import com.getcapacitor.PluginCall;
|
|
9
|
+
import com.getcapacitor.PluginMethod;
|
|
10
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
11
|
+
|
|
12
|
+
@CapacitorPlugin(name = "NativeMarket")
|
|
13
|
+
public class NativeMarket extends Plugin {
|
|
14
|
+
|
|
15
|
+
private final String pluginVersion = "";
|
|
16
|
+
|
|
17
|
+
@PluginMethod
|
|
18
|
+
public void openStoreListing(PluginCall call) {
|
|
19
|
+
try {
|
|
20
|
+
String appId = call.getString("appId");
|
|
21
|
+
if (appId == null || appId.isEmpty()) {
|
|
22
|
+
call.reject("appId is missing");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Context context = this.bridge.getActivity().getApplicationContext();
|
|
27
|
+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appId));
|
|
28
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
29
|
+
context.startActivity(intent);
|
|
30
|
+
|
|
31
|
+
call.resolve();
|
|
32
|
+
} catch (Exception ex) {
|
|
33
|
+
call.reject(ex.getLocalizedMessage());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@PluginMethod
|
|
38
|
+
public void openDevPage(PluginCall call) {
|
|
39
|
+
try {
|
|
40
|
+
String devId = call.getString("devId");
|
|
41
|
+
if (devId == null || devId.isEmpty()) {
|
|
42
|
+
call.reject("devId is missing");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
Context context = this.getContext();
|
|
47
|
+
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
48
|
+
intent.setData(Uri.parse("https://play.google.com/store/apps/dev?id=" + devId));
|
|
49
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
50
|
+
context.startActivity(intent);
|
|
51
|
+
|
|
52
|
+
call.resolve();
|
|
53
|
+
} catch (Exception ex) {
|
|
54
|
+
call.reject(ex.getLocalizedMessage());
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@PluginMethod
|
|
59
|
+
public void openCollection(PluginCall call) {
|
|
60
|
+
try {
|
|
61
|
+
String name = call.getString("name");
|
|
62
|
+
if (name == null || name.isEmpty()) {
|
|
63
|
+
call.reject("name is missing");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
Context context = this.getContext();
|
|
68
|
+
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
69
|
+
intent.setData(Uri.parse("https://play.google.com/store/apps/collection/" + name));
|
|
70
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
71
|
+
context.startActivity(intent);
|
|
72
|
+
|
|
73
|
+
call.resolve();
|
|
74
|
+
} catch (Exception ex) {
|
|
75
|
+
call.reject(ex.getLocalizedMessage());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@PluginMethod
|
|
80
|
+
public void openEditorChoicePage(PluginCall call) {
|
|
81
|
+
try {
|
|
82
|
+
String editorChoice = call.getString("editorChoice");
|
|
83
|
+
if (editorChoice == null || editorChoice.isEmpty()) {
|
|
84
|
+
call.reject("editorChoice is missing");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
Context context = this.getContext();
|
|
89
|
+
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
90
|
+
intent.setData(Uri.parse("https://play.google.com/store/apps/topic?id=" + editorChoice));
|
|
91
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
92
|
+
context.startActivity(intent);
|
|
93
|
+
|
|
94
|
+
call.resolve();
|
|
95
|
+
} catch (Exception ex) {
|
|
96
|
+
call.reject(ex.getLocalizedMessage());
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@PluginMethod
|
|
101
|
+
public void search(PluginCall call) {
|
|
102
|
+
try {
|
|
103
|
+
String terms = call.getString("terms");
|
|
104
|
+
if (terms == null || terms.isEmpty()) {
|
|
105
|
+
call.reject("terms is missing");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
Context context = this.getContext();
|
|
110
|
+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=" + terms));
|
|
111
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
112
|
+
context.startActivity(intent);
|
|
113
|
+
|
|
114
|
+
call.resolve();
|
|
115
|
+
} catch (Exception ex) {
|
|
116
|
+
call.reject(ex.getLocalizedMessage());
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@PluginMethod
|
|
121
|
+
public void getPluginVersion(final PluginCall call) {
|
|
122
|
+
try {
|
|
123
|
+
final JSObject ret = new JSObject();
|
|
124
|
+
ret.put("version", this.pluginVersion);
|
|
125
|
+
call.resolve(ret);
|
|
126
|
+
} catch (final Exception e) {
|
|
127
|
+
call.reject("Could not get plugin version", e);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "NativeMarketPlugin",
|
|
4
|
+
"slug": "nativemarketplugin",
|
|
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
|
+
],
|
|
12
|
+
"methods": [
|
|
13
|
+
{
|
|
14
|
+
"name": "openStoreListing",
|
|
15
|
+
"signature": "(options: { appId: string; country?: string; }) => Promise<void>",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"name": "options",
|
|
19
|
+
"docs": "- Configuration for opening the store listing",
|
|
20
|
+
"type": "{ appId: string; country?: string | undefined; }"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"returns": "Promise<void>",
|
|
24
|
+
"tags": [
|
|
25
|
+
{
|
|
26
|
+
"name": "param",
|
|
27
|
+
"text": "options - Configuration for opening the store listing"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "returns",
|
|
31
|
+
"text": "Promise that resolves when the store is opened"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "throws",
|
|
35
|
+
"text": "Error if opening the store fails"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "since",
|
|
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```"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"docs": "Launch app listing page in Play Store (Android) or App Store (iOS).",
|
|
47
|
+
"complexTypes": [],
|
|
48
|
+
"slug": "openstorelisting"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "openDevPage",
|
|
52
|
+
"signature": "(options: { devId: string; }) => Promise<void>",
|
|
53
|
+
"parameters": [
|
|
54
|
+
{
|
|
55
|
+
"name": "options",
|
|
56
|
+
"docs": "- Configuration with developer ID",
|
|
57
|
+
"type": "{ devId: string; }"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"returns": "Promise<void>",
|
|
61
|
+
"tags": [
|
|
62
|
+
{
|
|
63
|
+
"name": "param",
|
|
64
|
+
"text": "options - Configuration with developer ID"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "returns",
|
|
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"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "since",
|
|
76
|
+
"text": "1.0.0"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "example",
|
|
80
|
+
"text": "```typescript\nawait NativeMarket.openDevPage({\n devId: 'Google+LLC'\n});\n```"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"docs": "Deep-link directly to a developer's page in the Play Store.\nAndroid only.",
|
|
84
|
+
"complexTypes": [],
|
|
85
|
+
"slug": "opendevpage"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "openCollection",
|
|
89
|
+
"signature": "(options: { name: string; }) => Promise<void>",
|
|
90
|
+
"parameters": [
|
|
91
|
+
{
|
|
92
|
+
"name": "options",
|
|
93
|
+
"docs": "- Configuration with collection name",
|
|
94
|
+
"type": "{ name: string; }"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"returns": "Promise<void>",
|
|
98
|
+
"tags": [
|
|
99
|
+
{
|
|
100
|
+
"name": "param",
|
|
101
|
+
"text": "options - Configuration with collection name"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "returns",
|
|
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"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "since",
|
|
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"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"docs": "Link users to a collection or top charts in the Play Store.\nAndroid only.",
|
|
125
|
+
"complexTypes": [],
|
|
126
|
+
"slug": "opencollection"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "openEditorChoicePage",
|
|
130
|
+
"signature": "(options: { editorChoice: string; }) => Promise<void>",
|
|
131
|
+
"parameters": [
|
|
132
|
+
{
|
|
133
|
+
"name": "options",
|
|
134
|
+
"docs": "- Configuration with editor choice ID",
|
|
135
|
+
"type": "{ editorChoice: string; }"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"returns": "Promise<void>",
|
|
139
|
+
"tags": [
|
|
140
|
+
{
|
|
141
|
+
"name": "param",
|
|
142
|
+
"text": "options - Configuration with editor choice ID"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "returns",
|
|
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"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "since",
|
|
154
|
+
"text": "1.0.0"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "example",
|
|
158
|
+
"text": "```typescript\nawait NativeMarket.openEditorChoicePage({\n editorChoice: 'editorial_fitness_apps_us'\n});\n```"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"docs": "Link users to Editor's choice page in the Play Store.\nAndroid only.",
|
|
162
|
+
"complexTypes": [],
|
|
163
|
+
"slug": "openeditorchoicepage"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "search",
|
|
167
|
+
"signature": "(options: { terms: string; }) => Promise<void>",
|
|
168
|
+
"parameters": [
|
|
169
|
+
{
|
|
170
|
+
"name": "options",
|
|
171
|
+
"docs": "- Configuration with search terms",
|
|
172
|
+
"type": "{ terms: string; }"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"returns": "Promise<void>",
|
|
176
|
+
"tags": [
|
|
177
|
+
{
|
|
178
|
+
"name": "param",
|
|
179
|
+
"text": "options - Configuration with search terms"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "returns",
|
|
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"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "since",
|
|
191
|
+
"text": "1.0.0"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "example",
|
|
195
|
+
"text": "```typescript\nawait NativeMarket.search({\n terms: 'fitness apps'\n});\n```"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"docs": "Search the Play Store with custom search terms.\nAndroid only.",
|
|
199
|
+
"complexTypes": [],
|
|
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"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"properties": []
|
|
231
|
+
},
|
|
232
|
+
"interfaces": [],
|
|
233
|
+
"enums": [],
|
|
234
|
+
"typeAliases": [],
|
|
235
|
+
"pluginConfigs": []
|
|
236
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capacitor Native Market Plugin for opening app store listings and pages.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
export interface NativeMarketPlugin {
|
|
7
|
+
/**
|
|
8
|
+
* Launch app listing page in Play Store (Android) or App Store (iOS).
|
|
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
|
|
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
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
openStoreListing(options: {
|
|
29
|
+
appId: string;
|
|
30
|
+
country?: string;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Deep-link directly to a developer's page in the Play Store.
|
|
34
|
+
* Android only.
|
|
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
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* await NativeMarket.openDevPage({
|
|
43
|
+
* devId: 'Google+LLC'
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
openDevPage(options: {
|
|
48
|
+
devId: string;
|
|
49
|
+
}): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Link users to a collection or top charts in the Play Store.
|
|
52
|
+
* Android only.
|
|
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
|
|
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
|
|
65
|
+
*/
|
|
66
|
+
openCollection(options: {
|
|
67
|
+
name: string;
|
|
68
|
+
}): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Link users to Editor's choice page in the Play Store.
|
|
71
|
+
* Android only.
|
|
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
|
|
76
|
+
* @since 1.0.0
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* await NativeMarket.openEditorChoicePage({
|
|
80
|
+
* editorChoice: 'editorial_fitness_apps_us'
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
openEditorChoicePage(options: {
|
|
85
|
+
editorChoice: string;
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Search the Play Store with custom search terms.
|
|
89
|
+
* Android only.
|
|
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
|
|
94
|
+
* @since 1.0.0
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* await NativeMarket.search({
|
|
98
|
+
* terms: 'fitness apps'
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
search(options: {
|
|
103
|
+
terms: string;
|
|
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
|
+
}>;
|
|
120
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const NativeMarket = registerPlugin('NativeMarket', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.NativeMarketWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { NativeMarket };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,YAAY,GAAG,cAAc,CAAqB,cAAc,EAAE;IACtE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;CAChE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { NativeMarketPlugin } from './definitions';
|
|
3
|
+
export declare class NativeMarketWeb extends WebPlugin implements NativeMarketPlugin {
|
|
4
|
+
openStoreListing(options: {
|
|
5
|
+
appId: string;
|
|
6
|
+
country?: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
openDevPage(options: {
|
|
9
|
+
devId: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
openCollection(options: {
|
|
12
|
+
name: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
openEditorChoicePage(options: {
|
|
15
|
+
editorChoice: string;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
search(options: {
|
|
18
|
+
terms: string;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
getPluginVersion(): Promise<{
|
|
21
|
+
version: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class NativeMarketWeb extends WebPlugin {
|
|
3
|
+
openStoreListing(options) {
|
|
4
|
+
throw new Error('Method not implemented.' + options);
|
|
5
|
+
}
|
|
6
|
+
openDevPage(options) {
|
|
7
|
+
throw new Error('Method not implemented.' + options);
|
|
8
|
+
}
|
|
9
|
+
openCollection(options) {
|
|
10
|
+
throw new Error('Method not implemented.' + options);
|
|
11
|
+
}
|
|
12
|
+
openEditorChoicePage(options) {
|
|
13
|
+
throw new Error('Method not implemented.' + options);
|
|
14
|
+
}
|
|
15
|
+
search(options) {
|
|
16
|
+
throw new Error('Method not implemented.' + options);
|
|
17
|
+
}
|
|
18
|
+
async getPluginVersion() {
|
|
19
|
+
return { version: 'web' };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +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;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
const NativeMarket = core.registerPlugin('NativeMarket', {
|
|
6
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NativeMarketWeb()),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
class NativeMarketWeb extends core.WebPlugin {
|
|
10
|
+
openStoreListing(options) {
|
|
11
|
+
throw new Error('Method not implemented.' + options);
|
|
12
|
+
}
|
|
13
|
+
openDevPage(options) {
|
|
14
|
+
throw new Error('Method not implemented.' + options);
|
|
15
|
+
}
|
|
16
|
+
openCollection(options) {
|
|
17
|
+
throw new Error('Method not implemented.' + options);
|
|
18
|
+
}
|
|
19
|
+
openEditorChoicePage(options) {
|
|
20
|
+
throw new Error('Method not implemented.' + options);
|
|
21
|
+
}
|
|
22
|
+
search(options) {
|
|
23
|
+
throw new Error('Method not implemented.' + options);
|
|
24
|
+
}
|
|
25
|
+
async getPluginVersion() {
|
|
26
|
+
return { version: 'web' };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
31
|
+
__proto__: null,
|
|
32
|
+
NativeMarketWeb: NativeMarketWeb
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
exports.NativeMarket = NativeMarket;
|
|
36
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +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 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;;;;;;;;;"}
|