@capgo/native-market 7.1.10 → 7.1.16
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/android/src/main/java/com/getcapacitor/community/nativemarket/NativeMarket.java +97 -109
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/web.d.ts +2 -2
- package/dist/esm/web.js +6 -6
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +6 -6
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +6 -6
- package/dist/plugin.js.map +1 -1
- package/package.json +2 -2
|
@@ -11,118 +11,106 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
11
11
|
@CapacitorPlugin(name = "NativeMarket")
|
|
12
12
|
public class NativeMarket extends Plugin {
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} catch (Exception ex) {
|
|
33
|
-
call.reject(ex.getLocalizedMessage());
|
|
14
|
+
@PluginMethod
|
|
15
|
+
public void openStoreListing(PluginCall call) {
|
|
16
|
+
try {
|
|
17
|
+
String appId = call.getString("appId");
|
|
18
|
+
if (appId == null || appId.isEmpty()) {
|
|
19
|
+
call.reject("appId is missing");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Context context = this.bridge.getActivity().getApplicationContext();
|
|
24
|
+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appId));
|
|
25
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
26
|
+
context.startActivity(intent);
|
|
27
|
+
|
|
28
|
+
call.resolve();
|
|
29
|
+
} catch (Exception ex) {
|
|
30
|
+
call.reject(ex.getLocalizedMessage());
|
|
31
|
+
}
|
|
34
32
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} catch (Exception ex) {
|
|
56
|
-
call.reject(ex.getLocalizedMessage());
|
|
33
|
+
|
|
34
|
+
@PluginMethod
|
|
35
|
+
public void openDevPage(PluginCall call) {
|
|
36
|
+
try {
|
|
37
|
+
String devId = call.getString("devId");
|
|
38
|
+
if (devId == null || devId.isEmpty()) {
|
|
39
|
+
call.reject("devId is missing");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Context context = this.getContext();
|
|
44
|
+
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
45
|
+
intent.setData(Uri.parse("https://play.google.com/store/apps/dev?id=" + devId));
|
|
46
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
47
|
+
context.startActivity(intent);
|
|
48
|
+
|
|
49
|
+
call.resolve();
|
|
50
|
+
} catch (Exception ex) {
|
|
51
|
+
call.reject(ex.getLocalizedMessage());
|
|
52
|
+
}
|
|
57
53
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} catch (Exception ex) {
|
|
79
|
-
call.reject(ex.getLocalizedMessage());
|
|
54
|
+
|
|
55
|
+
@PluginMethod
|
|
56
|
+
public void openCollection(PluginCall call) {
|
|
57
|
+
try {
|
|
58
|
+
String name = call.getString("name");
|
|
59
|
+
if (name == null || name.isEmpty()) {
|
|
60
|
+
call.reject("name is missing");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Context context = this.getContext();
|
|
65
|
+
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
66
|
+
intent.setData(Uri.parse("https://play.google.com/store/apps/collection/" + name));
|
|
67
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
68
|
+
context.startActivity(intent);
|
|
69
|
+
|
|
70
|
+
call.resolve();
|
|
71
|
+
} catch (Exception ex) {
|
|
72
|
+
call.reject(ex.getLocalizedMessage());
|
|
73
|
+
}
|
|
80
74
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
} catch (Exception ex) {
|
|
102
|
-
call.reject(ex.getLocalizedMessage());
|
|
75
|
+
|
|
76
|
+
@PluginMethod
|
|
77
|
+
public void openEditorChoicePage(PluginCall call) {
|
|
78
|
+
try {
|
|
79
|
+
String editorChoice = call.getString("editorChoice");
|
|
80
|
+
if (editorChoice == null || editorChoice.isEmpty()) {
|
|
81
|
+
call.reject("editorChoice is missing");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
Context context = this.getContext();
|
|
86
|
+
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
87
|
+
intent.setData(Uri.parse("https://play.google.com/store/apps/topic?id=" + editorChoice));
|
|
88
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
89
|
+
context.startActivity(intent);
|
|
90
|
+
|
|
91
|
+
call.resolve();
|
|
92
|
+
} catch (Exception ex) {
|
|
93
|
+
call.reject(ex.getLocalizedMessage());
|
|
94
|
+
}
|
|
103
95
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
call.resolve();
|
|
124
|
-
} catch (Exception ex) {
|
|
125
|
-
call.reject(ex.getLocalizedMessage());
|
|
96
|
+
|
|
97
|
+
@PluginMethod
|
|
98
|
+
public void search(PluginCall call) {
|
|
99
|
+
try {
|
|
100
|
+
String terms = call.getString("terms");
|
|
101
|
+
if (terms == null || terms.isEmpty()) {
|
|
102
|
+
call.reject("terms is missing");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
Context context = this.getContext();
|
|
107
|
+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=" + terms));
|
|
108
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
109
|
+
context.startActivity(intent);
|
|
110
|
+
|
|
111
|
+
call.resolve();
|
|
112
|
+
} catch (Exception ex) {
|
|
113
|
+
call.reject(ex.getLocalizedMessage());
|
|
114
|
+
}
|
|
126
115
|
}
|
|
127
|
-
}
|
|
128
116
|
}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerPlugin } from
|
|
2
|
-
const NativeMarket = registerPlugin(
|
|
3
|
-
web: () => import(
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const NativeMarket = registerPlugin('NativeMarket', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.NativeMarketWeb()),
|
|
4
4
|
});
|
|
5
|
-
export * from
|
|
5
|
+
export * from './definitions';
|
|
6
6
|
export { NativeMarket };
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WebPlugin } from
|
|
2
|
-
import type { NativeMarketPlugin } from
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { NativeMarketPlugin } from './definitions';
|
|
3
3
|
export declare class NativeMarketWeb extends WebPlugin implements NativeMarketPlugin {
|
|
4
4
|
openStoreListing(options: {
|
|
5
5
|
appId: string;
|
package/dist/esm/web.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { WebPlugin } from
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
2
|
export class NativeMarketWeb extends WebPlugin {
|
|
3
3
|
openStoreListing(options) {
|
|
4
|
-
throw new Error(
|
|
4
|
+
throw new Error('Method not implemented.' + options);
|
|
5
5
|
}
|
|
6
6
|
openDevPage(options) {
|
|
7
|
-
throw new Error(
|
|
7
|
+
throw new Error('Method not implemented.' + options);
|
|
8
8
|
}
|
|
9
9
|
openCollection(options) {
|
|
10
|
-
throw new Error(
|
|
10
|
+
throw new Error('Method not implemented.' + options);
|
|
11
11
|
}
|
|
12
12
|
openEditorChoicePage(options) {
|
|
13
|
-
throw new Error(
|
|
13
|
+
throw new Error('Method not implemented.' + options);
|
|
14
14
|
}
|
|
15
15
|
search(options) {
|
|
16
|
-
throw new Error(
|
|
16
|
+
throw new Error('Method not implemented.' + options);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=web.js.map
|
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,
|
|
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"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
|
-
const NativeMarket = core.registerPlugin(
|
|
5
|
+
const NativeMarket = core.registerPlugin('NativeMarket', {
|
|
6
6
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NativeMarketWeb()),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
class NativeMarketWeb extends core.WebPlugin {
|
|
10
10
|
openStoreListing(options) {
|
|
11
|
-
throw new Error(
|
|
11
|
+
throw new Error('Method not implemented.' + options);
|
|
12
12
|
}
|
|
13
13
|
openDevPage(options) {
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error('Method not implemented.' + options);
|
|
15
15
|
}
|
|
16
16
|
openCollection(options) {
|
|
17
|
-
throw new Error(
|
|
17
|
+
throw new Error('Method not implemented.' + options);
|
|
18
18
|
}
|
|
19
19
|
openEditorChoicePage(options) {
|
|
20
|
-
throw new Error(
|
|
20
|
+
throw new Error('Method not implemented.' + options);
|
|
21
21
|
}
|
|
22
22
|
search(options) {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error('Method not implemented.' + options);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
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
|
|
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;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
var capacitorCapacitorUpdater = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
const NativeMarket = core.registerPlugin(
|
|
4
|
+
const NativeMarket = core.registerPlugin('NativeMarket', {
|
|
5
5
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NativeMarketWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
class NativeMarketWeb extends core.WebPlugin {
|
|
9
9
|
openStoreListing(options) {
|
|
10
|
-
throw new Error(
|
|
10
|
+
throw new Error('Method not implemented.' + options);
|
|
11
11
|
}
|
|
12
12
|
openDevPage(options) {
|
|
13
|
-
throw new Error(
|
|
13
|
+
throw new Error('Method not implemented.' + options);
|
|
14
14
|
}
|
|
15
15
|
openCollection(options) {
|
|
16
|
-
throw new Error(
|
|
16
|
+
throw new Error('Method not implemented.' + options);
|
|
17
17
|
}
|
|
18
18
|
openEditorChoicePage(options) {
|
|
19
|
-
throw new Error(
|
|
19
|
+
throw new Error('Method not implemented.' + options);
|
|
20
20
|
}
|
|
21
21
|
search(options) {
|
|
22
|
-
throw new Error(
|
|
22
|
+
throw new Error('Method not implemented.' + options);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
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
|
|
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;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/native-market",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.16",
|
|
4
4
|
"description": "A native market plugin for linking to google play or app store.",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
39
39
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --autocorrect --format",
|
|
40
40
|
"eslint": "eslint .",
|
|
41
|
-
"prettier": "prettier
|
|
41
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
42
42
|
"swiftlint": "node-swiftlint",
|
|
43
43
|
"docgen": "docgen --api NativeMarketPlugin --output-readme README.md --output-json dist/docs.json",
|
|
44
44
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|