@capgo/native-market 7.0.0 → 7.1.6

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.
Files changed (49) hide show
  1. package/.eslintignore +5 -0
  2. package/.github/FUNDING.yml +1 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.yml +86 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.yml +45 -0
  5. package/.github/workflows/autofix.yml +23 -0
  6. package/.github/workflows/build.yml +82 -0
  7. package/.github/workflows/bump_version.yml +57 -0
  8. package/.github/workflows/test.yml +58 -0
  9. package/.prettierrc.js +3 -0
  10. package/CHANGELOG.md +502 -0
  11. package/CapgoNativeMarket.podspec +1 -1
  12. package/PLUGIN_AUTHOR_README.md +51 -0
  13. package/README.md +8 -24
  14. package/android/build.gradle +7 -7
  15. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  16. package/android/gradle/wrapper/gradle-wrapper.properties +2 -1
  17. package/android/gradlew +21 -13
  18. package/android/gradlew.bat +12 -10
  19. package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +1 -2
  20. package/android/src/main/java/com/getcapacitor/community/nativemarket/NativeMarket.java +70 -73
  21. package/bun.lock +820 -0
  22. package/dist/docs.json +10 -10
  23. package/dist/esm/web.d.ts +5 -5
  24. package/dist/esm/web.js +10 -10
  25. package/dist/esm/web.js.map +1 -1
  26. package/dist/plugin.cjs.js +10 -10
  27. package/dist/plugin.cjs.js.map +1 -1
  28. package/dist/plugin.js +10 -10
  29. package/dist/plugin.js.map +1 -1
  30. package/ios/Plugin/Plugin.swift +31 -12
  31. package/ios/Plugin.xcodeproj/project.pbxproj +4 -12
  32. package/ios/Plugin.xcworkspace/contents.xcworkspacedata +10 -0
  33. package/ios/PluginTests/PluginTests.swift +0 -10
  34. package/ios/Podfile +1 -1
  35. package/java_code_style.xml +24 -0
  36. package/package.json +46 -51
  37. package/renovate.json +20 -0
  38. package/rollup.config.mjs +22 -0
  39. package/src/definitions.ts +58 -0
  40. package/src/index.ts +10 -0
  41. package/src/web.ts +28 -0
  42. package/tsconfig.json +19 -0
  43. package/android/android.iml +0 -109
  44. package/android/src/main/res/layout/bridge_layout_main.xml +0 -15
  45. package/android/src/main/res/values/colors.xml +0 -3
  46. package/android/src/main/res/values/strings.xml +0 -3
  47. package/android/src/main/res/values/styles.xml +0 -3
  48. package/ios/Plugin/Plugin.h +0 -10
  49. package/ios/Plugin/Plugin.m +0 -12
package/dist/docs.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "methods": [
8
8
  {
9
9
  "name": "openStoreListing",
10
- "signature": "(options: { appId: string; country?: string; }) => any",
10
+ "signature": "(options: { appId: string; country?: string; }) => Promise<void>",
11
11
  "parameters": [
12
12
  {
13
13
  "name": "options",
@@ -15,7 +15,7 @@
15
15
  "type": "{ appId: string; country?: string | undefined; }"
16
16
  }
17
17
  ],
18
- "returns": "any",
18
+ "returns": "Promise<void>",
19
19
  "tags": [
20
20
  {
21
21
  "name": "param",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  {
42
42
  "name": "openDevPage",
43
- "signature": "(options: { devId: string; }) => any",
43
+ "signature": "(options: { devId: string; }) => Promise<void>",
44
44
  "parameters": [
45
45
  {
46
46
  "name": "options",
@@ -48,7 +48,7 @@
48
48
  "type": "{ devId: string; }"
49
49
  }
50
50
  ],
51
- "returns": "any",
51
+ "returns": "Promise<void>",
52
52
  "tags": [
53
53
  {
54
54
  "name": "param",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  {
71
71
  "name": "openCollection",
72
- "signature": "(options: { name: string; }) => any",
72
+ "signature": "(options: { name: string; }) => Promise<void>",
73
73
  "parameters": [
74
74
  {
75
75
  "name": "options",
@@ -77,7 +77,7 @@
77
77
  "type": "{ name: string; }"
78
78
  }
79
79
  ],
80
- "returns": "any",
80
+ "returns": "Promise<void>",
81
81
  "tags": [
82
82
  {
83
83
  "name": "param",
@@ -98,7 +98,7 @@
98
98
  },
99
99
  {
100
100
  "name": "openEditorChoicePage",
101
- "signature": "(options: { editorChoice: string; }) => any",
101
+ "signature": "(options: { editorChoice: string; }) => Promise<void>",
102
102
  "parameters": [
103
103
  {
104
104
  "name": "options",
@@ -106,7 +106,7 @@
106
106
  "type": "{ editorChoice: string; }"
107
107
  }
108
108
  ],
109
- "returns": "any",
109
+ "returns": "Promise<void>",
110
110
  "tags": [
111
111
  {
112
112
  "name": "param",
@@ -127,7 +127,7 @@
127
127
  },
128
128
  {
129
129
  "name": "search",
130
- "signature": "(options: { terms: string; }) => any",
130
+ "signature": "(options: { terms: string; }) => Promise<void>",
131
131
  "parameters": [
132
132
  {
133
133
  "name": "options",
@@ -135,7 +135,7 @@
135
135
  "type": "{ terms: string; }"
136
136
  }
137
137
  ],
138
- "returns": "any",
138
+ "returns": "Promise<void>",
139
139
  "tags": [
140
140
  {
141
141
  "name": "param",
package/dist/esm/web.d.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  import { WebPlugin } from "@capacitor/core";
2
2
  import type { NativeMarketPlugin } from "./definitions";
3
3
  export declare class NativeMarketWeb extends WebPlugin implements NativeMarketPlugin {
4
- openStoreListing(_options: {
4
+ openStoreListing(options: {
5
5
  appId: string;
6
6
  country?: string;
7
7
  }): Promise<void>;
8
- openDevPage(_options: {
8
+ openDevPage(options: {
9
9
  devId: string;
10
10
  }): Promise<void>;
11
- openCollection(_options: {
11
+ openCollection(options: {
12
12
  name: string;
13
13
  }): Promise<void>;
14
- openEditorChoicePage(_options: {
14
+ openEditorChoicePage(options: {
15
15
  editorChoice: string;
16
16
  }): Promise<void>;
17
- search(_options: {
17
+ search(options: {
18
18
  terms: string;
19
19
  }): Promise<void>;
20
20
  }
package/dist/esm/web.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import { WebPlugin } from "@capacitor/core";
2
2
  export class NativeMarketWeb extends WebPlugin {
3
- openStoreListing(_options) {
4
- throw new Error("Method not implemented.");
3
+ openStoreListing(options) {
4
+ throw new Error("Method not implemented." + options);
5
5
  }
6
- openDevPage(_options) {
7
- throw new Error("Method not implemented.");
6
+ openDevPage(options) {
7
+ throw new Error("Method not implemented." + options);
8
8
  }
9
- openCollection(_options) {
10
- throw new Error("Method not implemented.");
9
+ openCollection(options) {
10
+ throw new Error("Method not implemented." + options);
11
11
  }
12
- openEditorChoicePage(_options) {
13
- throw new Error("Method not implemented.");
12
+ openEditorChoicePage(options) {
13
+ throw new Error("Method not implemented." + options);
14
14
  }
15
- search(_options) {
16
- throw new Error("Method not implemented.");
15
+ search(options) {
16
+ throw new Error("Method not implemented." + options);
17
17
  }
18
18
  }
19
19
  //# sourceMappingURL=web.js.map
@@ -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,QAGhB;QACC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,WAAW,CAAC,QAA2B;QACrC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,cAAc,CAAC,QAA0B;QACvC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,oBAAoB,CAAC,QAAkC;QACrD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,QAA2B;QAChC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,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,OAGhB;QACC,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"}
@@ -7,20 +7,20 @@ const NativeMarket = core.registerPlugin("NativeMarket", {
7
7
  });
8
8
 
9
9
  class NativeMarketWeb extends core.WebPlugin {
10
- openStoreListing(_options) {
11
- throw new Error("Method not implemented.");
10
+ openStoreListing(options) {
11
+ throw new Error("Method not implemented." + options);
12
12
  }
13
- openDevPage(_options) {
14
- throw new Error("Method not implemented.");
13
+ openDevPage(options) {
14
+ throw new Error("Method not implemented." + options);
15
15
  }
16
- openCollection(_options) {
17
- throw new Error("Method not implemented.");
16
+ openCollection(options) {
17
+ throw new Error("Method not implemented." + options);
18
18
  }
19
- openEditorChoicePage(_options) {
20
- throw new Error("Method not implemented.");
19
+ openEditorChoicePage(options) {
20
+ throw new Error("Method not implemented." + options);
21
21
  }
22
- search(_options) {
23
- throw new Error("Method not implemented.");
22
+ search(options) {
23
+ throw new Error("Method not implemented." + options);
24
24
  }
25
25
  }
26
26
 
@@ -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.\");\n }\n openDevPage(_options) {\n throw new Error(\"Method not implemented.\");\n }\n openCollection(_options) {\n throw new Error(\"Method not implemented.\");\n }\n openEditorChoicePage(_options) {\n throw new Error(\"Method not implemented.\");\n }\n search(_options) {\n throw new Error(\"Method not implemented.\");\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,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,oBAAoB,CAAC,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,CAAC,QAAQ,EAAE;AACrB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL;;;;;;;;;"}
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;AACA,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D;AACA,IAAI,cAAc,CAAC,OAAO,EAAE;AAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D;AACA,IAAI,oBAAoB,CAAC,OAAO,EAAE;AAClC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D;AACA,IAAI,MAAM,CAAC,OAAO,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;AAC5D;AACA;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -6,20 +6,20 @@ var capacitorCapacitorUpdater = (function (exports, core) {
6
6
  });
7
7
 
8
8
  class NativeMarketWeb extends core.WebPlugin {
9
- openStoreListing(_options) {
10
- throw new Error("Method not implemented.");
9
+ openStoreListing(options) {
10
+ throw new Error("Method not implemented." + options);
11
11
  }
12
- openDevPage(_options) {
13
- throw new Error("Method not implemented.");
12
+ openDevPage(options) {
13
+ throw new Error("Method not implemented." + options);
14
14
  }
15
- openCollection(_options) {
16
- throw new Error("Method not implemented.");
15
+ openCollection(options) {
16
+ throw new Error("Method not implemented." + options);
17
17
  }
18
- openEditorChoicePage(_options) {
19
- throw new Error("Method not implemented.");
18
+ openEditorChoicePage(options) {
19
+ throw new Error("Method not implemented." + options);
20
20
  }
21
- search(_options) {
22
- throw new Error("Method not implemented.");
21
+ search(options) {
22
+ throw new Error("Method not implemented." + options);
23
23
  }
24
24
  }
25
25
 
@@ -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.\");\n }\n openDevPage(_options) {\n throw new Error(\"Method not implemented.\");\n }\n openCollection(_options) {\n throw new Error(\"Method not implemented.\");\n }\n openEditorChoicePage(_options) {\n throw new Error(\"Method not implemented.\");\n }\n search(_options) {\n throw new Error(\"Method not implemented.\");\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,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,WAAW,CAAC,QAAQ,EAAE;IAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,oBAAoB,CAAC,QAAQ,EAAE;IACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,MAAM,CAAC,QAAQ,EAAE;IACrB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL;;;;;;;;;;;;;;;"}
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;IACA,IAAI,WAAW,CAAC,OAAO,EAAE;IACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D;IACA,IAAI,cAAc,CAAC,OAAO,EAAE;IAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D;IACA,IAAI,oBAAoB,CAAC,OAAO,EAAE;IAClC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D;IACA,IAAI,MAAM,CAAC,OAAO,EAAE;IACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC;IAC5D;IACA;;;;;;;;;;;;;;;"}
@@ -24,8 +24,16 @@ struct APIResult: Codable {
24
24
  * here: https://capacitor.ionicframework.com/docs/plugins/ios
25
25
  */
26
26
  @objc(NativeMarket)
27
- public class NativeMarket: CAPPlugin {
28
-
27
+ public class NativeMarket: CAPPlugin, CAPBridgedPlugin {
28
+ public let identifier = "InAppBrowserPlugin"
29
+ public let jsName = "InAppBrowser"
30
+ public let pluginMethods: [CAPPluginMethod] = [
31
+ CAPPluginMethod(name: "openStoreListing", returnType: CAPPluginReturnPromise),
32
+ CAPPluginMethod(name: "openDevPage", returnType: CAPPluginReturnPromise),
33
+ CAPPluginMethod(name: "openCollection", returnType: CAPPluginReturnPromise),
34
+ CAPPluginMethod(name: "openEditorChoicePage", returnType: CAPPluginReturnPromise),
35
+ CAPPluginMethod(name: "search", returnType: CAPPluginReturnPromise)
36
+ ]
29
37
  @objc func openStoreListing(_ call: CAPPluginCall) {
30
38
  guard let appId = call.getString("appId") else {
31
39
  call.reject("appId is missing")
@@ -33,28 +41,39 @@ public class NativeMarket: CAPPlugin {
33
41
  }
34
42
  let country = call.getString("country") ?? ""
35
43
  do {
36
- let url = URL(string: "https://itunes.apple.com/lookup?bundleId=\(appId)&country=\(country)")
37
- let data = try Data(contentsOf: url!)
44
+ guard let url = URL(string: "https://itunes.apple.com/lookup?bundleId=\(appId)&country=\(country)") else {
45
+ throw NSError(domain: "Invalid URL", code: 0, userInfo: nil)
46
+ }
47
+ let data = try Data(contentsOf: url)
38
48
  let decoder = JSONDecoder()
39
- let apps = try! decoder.decode(APIResult.self, from: data).apps
40
- let urlStore = "itms-apps://itunes.apple.com/app/id\(apps[0].trackId)"
41
- let appUrl = URL(string: urlStore)
49
+ let apiResult = try decoder.decode(APIResult.self, from: data)
50
+
51
+ guard let firstApp = apiResult.apps.first else {
52
+ print("No apps found for given appId")
53
+ call.reject("No apps found for given appId")
54
+ return
55
+ }
56
+
57
+ let urlStore = "itms-apps://itunes.apple.com/app/id\(firstApp.trackId)"
58
+ guard let appUrl = URL(string: urlStore) else {
59
+ throw NSError(domain: "Invalid Store URL", code: 0, userInfo: nil)
60
+ }
42
61
 
43
62
  DispatchQueue.main.async {
44
- if UIApplication.shared.canOpenURL(appUrl!) {
63
+ if UIApplication.shared.canOpenURL(appUrl) {
45
64
  if #available(iOS 10.0, *) {
46
- UIApplication.shared.open(appUrl!, options: [:]) { (_) in
65
+ UIApplication.shared.open(appUrl, options: [:]) { (_) in
47
66
  call.resolve()
48
67
  }
49
68
  } else {
50
- UIApplication.shared.openURL(appUrl!)
69
+ UIApplication.shared.openURL(appUrl)
51
70
  call.resolve()
52
71
  }
53
72
  }
54
73
  }
55
74
  } catch {
56
- print("trackId cannot be found from appId")
57
- call.reject("trackId cannot be found from appId")
75
+ print("Error: \(error.localizedDescription)")
76
+ call.reject("Error: \(error.localizedDescription)")
58
77
  }
59
78
  }
60
79
 
@@ -11,9 +11,7 @@
11
11
  20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */; };
12
12
  50ADFF92201F53D600D50D53 /* NativeMarket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFF88201F53D600D50D53 /* NativeMarket.framework */; };
13
13
  50ADFF97201F53D600D50D53 /* PluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFF96201F53D600D50D53 /* PluginTests.swift */; };
14
- 50ADFF99201F53D600D50D53 /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ADFF8B201F53D600D50D53 /* Plugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
15
14
  50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFFA52020D75100D50D53 /* Capacitor.framework */; };
16
- 50ADFFA82020EE4F00D50D53 /* Plugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFFA72020EE4F00D50D53 /* Plugin.m */; };
17
15
  50E1A94820377CB70090CE1A /* Plugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E1A94720377CB70090CE1A /* Plugin.swift */; };
18
16
  /* End PBXBuildFile section */
19
17
 
@@ -30,13 +28,11 @@
30
28
  /* Begin PBXFileReference section */
31
29
  3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; };
32
30
  50ADFF88201F53D600D50D53 /* NativeMarket.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NativeMarket.framework; sourceTree = BUILT_PRODUCTS_DIR; };
33
- 50ADFF8B201F53D600D50D53 /* Plugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = "<group>"; };
34
31
  50ADFF8C201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
35
32
  50ADFF91201F53D600D50D53 /* PluginTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PluginTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
36
33
  50ADFF96201F53D600D50D53 /* PluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginTests.swift; sourceTree = "<group>"; };
37
34
  50ADFF98201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
38
35
  50ADFFA52020D75100D50D53 /* Capacitor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Capacitor.framework; sourceTree = BUILT_PRODUCTS_DIR; };
39
- 50ADFFA72020EE4F00D50D53 /* Plugin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Plugin.m; sourceTree = "<group>"; };
40
36
  50E1A94720377CB70090CE1A /* Plugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Plugin.swift; sourceTree = "<group>"; };
41
37
  5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig"; sourceTree = "<group>"; };
42
38
  91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.release.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig"; sourceTree = "<group>"; };
@@ -91,8 +87,6 @@
91
87
  isa = PBXGroup;
92
88
  children = (
93
89
  50E1A94720377CB70090CE1A /* Plugin.swift */,
94
- 50ADFF8B201F53D600D50D53 /* Plugin.h */,
95
- 50ADFFA72020EE4F00D50D53 /* Plugin.m */,
96
90
  50ADFF8C201F53D600D50D53 /* Info.plist */,
97
91
  );
98
92
  path = Plugin;
@@ -135,7 +129,6 @@
135
129
  isa = PBXHeadersBuildPhase;
136
130
  buildActionMask = 2147483647;
137
131
  files = (
138
- 50ADFF99201F53D600D50D53 /* Plugin.h in Headers */,
139
132
  );
140
133
  runOnlyForDeploymentPostprocessing = 0;
141
134
  };
@@ -303,7 +296,6 @@
303
296
  buildActionMask = 2147483647;
304
297
  files = (
305
298
  50E1A94820377CB70090CE1A /* Plugin.swift in Sources */,
306
- 50ADFFA82020EE4F00D50D53 /* Plugin.m in Sources */,
307
299
  );
308
300
  runOnlyForDeploymentPostprocessing = 0;
309
301
  };
@@ -375,7 +367,7 @@
375
367
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
376
368
  GCC_WARN_UNUSED_FUNCTION = YES;
377
369
  GCC_WARN_UNUSED_VARIABLE = YES;
378
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
370
+ IPHONEOS_DEPLOYMENT_TARGET = 14.0;
379
371
  MTL_ENABLE_DEBUG_INFO = YES;
380
372
  ONLY_ACTIVE_ARCH = YES;
381
373
  SDKROOT = iphoneos;
@@ -429,7 +421,7 @@
429
421
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
430
422
  GCC_WARN_UNUSED_FUNCTION = YES;
431
423
  GCC_WARN_UNUSED_VARIABLE = YES;
432
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
424
+ IPHONEOS_DEPLOYMENT_TARGET = 14.0;
433
425
  MTL_ENABLE_DEBUG_INFO = NO;
434
426
  SDKROOT = iphoneos;
435
427
  SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -452,7 +444,7 @@
452
444
  DYLIB_INSTALL_NAME_BASE = "@rpath";
453
445
  INFOPLIST_FILE = Plugin/Info.plist;
454
446
  INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
455
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
447
+ IPHONEOS_DEPLOYMENT_TARGET = 14.0;
456
448
  LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)";
457
449
  MARKETING_VERSION = 0.1;
458
450
  ONLY_ACTIVE_ARCH = YES;
@@ -478,7 +470,7 @@
478
470
  DYLIB_INSTALL_NAME_BASE = "@rpath";
479
471
  INFOPLIST_FILE = Plugin/Info.plist;
480
472
  INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
481
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
473
+ IPHONEOS_DEPLOYMENT_TARGET = 14.0;
482
474
  LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
483
475
  MARKETING_VERSION = 0.1;
484
476
  ONLY_ACTIVE_ARCH = NO;
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "group:Plugin.xcodeproj">
6
+ </FileRef>
7
+ <FileRef
8
+ location = "group:Pods/Pods.xcodeproj">
9
+ </FileRef>
10
+ </Workspace>
@@ -4,16 +4,6 @@ import Capacitor
4
4
 
5
5
  class PluginTests: XCTestCase {
6
6
 
7
- override func setUp() {
8
- super.setUp()
9
- // Put setup code here. This method is called before the invocation of each test method in the class.
10
- }
11
-
12
- override func tearDown() {
13
- // Put teardown code here. This method is called after the invocation of each test method in the class.
14
- super.tearDown()
15
- }
16
-
17
7
  func testEcho() {
18
8
  // This is an example of a functional test case for a plugin.
19
9
  // Use XCTAssert and related functions to verify your tests produce the correct results.
package/ios/Podfile CHANGED
@@ -1,4 +1,4 @@
1
- platform :ios, '13.0'
1
+ platform :ios, '14.0'
2
2
 
3
3
  def capacitor_pods
4
4
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
@@ -0,0 +1,24 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ <inspection_tool class="FieldMayBeFinal" enabled="true" level="ERROR" enabled_by_default="true" />
6
+ <inspection_tool class="GroovyVariableCanBeFinal" enabled="true" level="ERROR" enabled_by_default="true" />
7
+ <inspection_tool class="IOResource" enabled="true" level="WARNING" enabled_by_default="true">
8
+ <option name="ignoredTypesString" value="java.io.ByteArrayOutputStream,java.io.ByteArrayInputStream,java.io.StringBufferInputStream,java.io.CharArrayWriter,java.io.CharArrayReader,java.io.StringWriter,java.io.StringReader" />
9
+ <option name="insideTryAllowed" value="false" />
10
+ </inspection_tool>
11
+ <inspection_tool class="LocalCanBeFinal" enabled="true" level="ERROR" enabled_by_default="true">
12
+ <option name="REPORT_VARIABLES" value="true" />
13
+ <option name="REPORT_PARAMETERS" value="true" />
14
+ </inspection_tool>
15
+ <inspection_tool class="PublicField" enabled="true" level="WARNING" enabled_by_default="true">
16
+ <option name="ignoreEnums" value="false" />
17
+ <option name="ignorableAnnotations">
18
+ <value />
19
+ </option>
20
+ </inspection_tool>
21
+ <inspection_tool class="UnqualifiedFieldAccess" enabled="true" level="ERROR" enabled_by_default="true" />
22
+ <inspection_tool class="UnqualifiedMethodAccess" enabled="true" level="ERROR" enabled_by_default="true" />
23
+ </profile>
24
+ </component>
package/package.json CHANGED
@@ -1,63 +1,70 @@
1
1
  {
2
2
  "name": "@capgo/native-market",
3
- "version": "7.0.0",
3
+ "version": "7.1.6",
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/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",
8
+ "author": "Martin Donadieu <martin@capgo.app>",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/Cap-go/capacitor-native-market.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/Cap-go/capacitor-native-market/issues"
16
+ },
17
+ "keywords": [
18
+ "capacitor",
19
+ "plugin",
20
+ "market",
21
+ "google play",
22
+ "app store"
23
+ ],
8
24
  "scripts": {
9
25
  "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
10
- "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
26
+ "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -sdk iphoneos -scheme Plugin && cd ..",
11
27
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
12
28
  "verify:web": "npm run build",
13
29
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
14
30
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --autocorrect --format",
15
- "eslint": "eslint . --ext ts",
31
+ "eslint": "eslint .",
16
32
  "prettier": "prettier --config .prettierrc.js \"**/*.{css,html,ts,js,java}\"",
17
33
  "swiftlint": "node-swiftlint",
34
+ "docgen": "docgen --api NativeMarketPlugin --output-readme README.md --output-json dist/docs.json",
18
35
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
19
36
  "clean": "rimraf ./dist",
20
37
  "watch": "tsc --watch",
21
- "docgen": "docgen --api NativeMarketPlugin --output-readme README.md --output-json dist/docs.json",
22
38
  "prepublishOnly": "npm run build"
23
39
  },
24
- "author": "Martin Donadieu <martindonadieu@gmail.com>",
25
- "license": "MIT",
26
- "dependencies": {
27
- "@capacitor/core": "^5.0.3"
28
- },
29
40
  "devDependencies": {
30
- "@capacitor/android": "^5.0.3",
31
- "@capacitor/cli": "^5.0.3",
32
- "@capacitor/core": "^5.0.3",
33
- "@capacitor/docgen": "^0.2.1",
34
- "@capacitor/ios": "^5.0.3",
35
- "@ionic/eslint-config": "^0.3.0",
36
- "@ionic/prettier-config": "^3.0.0",
37
- "@ionic/swiftlint-config": "^1.1.2",
38
- "@typescript-eslint/eslint-plugin": "^5.59.7",
39
- "@typescript-eslint/parser": "^5.59.7",
40
- "eslint": "^8.41.0",
41
- "eslint-plugin-import": "^2.27.5",
42
- "husky": "^8.0.3",
43
- "prettier": "^2.8.8",
44
- "prettier-plugin-java": "^2.1.0",
45
- "rimraf": "^5.0.1",
46
- "rollup": "^3.23.0",
47
- "swiftlint": "^1.0.2",
48
- "typescript": "^5.0.4"
41
+ "@capacitor/android": "^7.0.0",
42
+ "@capacitor/core": "^7.0.0",
43
+ "@capacitor/cli": "^7.0.0",
44
+ "@capacitor/docgen": "^0.3.0",
45
+ "@capacitor/ios": "^7.0.0",
46
+ "@ionic/eslint-config": "^0.4.0",
47
+ "@ionic/prettier-config": "^4.0.0",
48
+ "@ionic/swiftlint-config": "^2.0.0",
49
+ "@types/node": "^22.13.1",
50
+ "eslint": "^8.57.0",
51
+ "eslint-plugin-import": "^2.31.0",
52
+ "husky": "^9.1.7",
53
+ "prettier": "^3.4.2",
54
+ "prettier-plugin-java": "^2.6.7",
55
+ "rimraf": "^6.0.1",
56
+ "rollup": "^4.34.6",
57
+ "swiftlint": "^2.0.0",
58
+ "typescript": "^5.7.3"
49
59
  },
50
- "files": [
51
- "dist/",
52
- "ios/",
53
- "android/",
54
- "CapgoNativeMarket.podspec"
55
- ],
56
- "keywords": [
57
- "capacitor",
58
- "plugin",
59
- "native"
60
- ],
60
+ "peerDependencies": {
61
+ "@capacitor/core": ">=7.0.0"
62
+ },
63
+ "eslintConfig": {
64
+ "extends": "@ionic/eslint-config/recommended"
65
+ },
66
+ "prettier": "@ionic/prettier-config",
67
+ "swiftlint": "@ionic/swiftlint-config",
61
68
  "capacitor": {
62
69
  "ios": {
63
70
  "src": "ios"
@@ -65,17 +72,5 @@
65
72
  "android": {
66
73
  "src": "android"
67
74
  }
68
- },
69
- "prettier": "@ionic/prettier-config",
70
- "swiftlint": "@ionic/swiftlint-config",
71
- "eslintConfig": {
72
- "extends": "@ionic/eslint-config/recommended"
73
- },
74
- "repository": {
75
- "type": "git",
76
- "url": "https://github.com/riderx/native-market"
77
- },
78
- "bugs": {
79
- "url": "https://github.com/riderx/native-market/issues"
80
75
  }
81
76
  }
package/renovate.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:base",
5
+ "schedule:earlyMondays"
6
+ ],
7
+ "lockFileMaintenance": {
8
+ "enabled": true,
9
+ "automerge": true,
10
+ "automergeType": "branch",
11
+ "platformAutomerge": true
12
+ },
13
+ "packageRules": [
14
+ {
15
+ "matchUpdateTypes": ["minor", "patch"],
16
+ "matchCurrentVersion": "!/^0/",
17
+ "automerge": true
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,22 @@
1
+ export default {
2
+ input: "dist/esm/index.js",
3
+ output: [
4
+ {
5
+ file: "dist/plugin.js",
6
+ format: "iife",
7
+ name: "capacitorCapacitorUpdater",
8
+ globals: {
9
+ "@capacitor/core": "capacitorExports",
10
+ },
11
+ sourcemap: true,
12
+ inlineDynamicImports: true,
13
+ },
14
+ {
15
+ file: "dist/plugin.cjs.js",
16
+ format: "cjs",
17
+ sourcemap: true,
18
+ inlineDynamicImports: true,
19
+ },
20
+ ],
21
+ external: ["@capacitor/core"],
22
+ };