@capgo/native-market 1.1.36 → 5.0.2

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 CHANGED
@@ -1,9 +1,16 @@
1
1
  # Capacitor Native Market Plugin
2
2
 
3
- <a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>
3
+ <a href="https://capgo.app/">
4
+ <img
5
+ src="https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png"
6
+ alt="Capgo - Instant updates for capacitor"
7
+ />
8
+ </a>
4
9
 
5
10
  <div align="center">
6
- <h2><a href="https://capgo.app/">Check out: Capgo — Instant updates for capacitor</a></h2>
11
+ <h2>
12
+ <a href="https://capgo.app/">Check out: Capgo — Instant updates for capacitor</a>
13
+ </h2>
7
14
  </div>
8
15
 
9
16
  Capacitor community plugin for native market for Play Store/App Store.
@@ -1,7 +1,8 @@
1
1
  ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
4
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
5
6
  }
6
7
 
7
8
  buildscript {
@@ -10,17 +11,18 @@ buildscript {
10
11
  mavenCentral()
11
12
  }
12
13
  dependencies {
13
- classpath 'com.android.tools.build:gradle:7.3.1'
14
+ classpath 'com.android.tools.build:gradle:8.0.2'
14
15
  }
15
16
  }
16
17
 
17
18
  apply plugin: 'com.android.library'
18
19
 
19
20
  android {
20
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
21
+ namespace "com.getcapacitor.community.nativemarket.nativemarket"
22
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
21
23
  defaultConfig {
22
24
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
23
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
25
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
24
26
  versionCode 1
25
27
  versionName "1.0"
26
28
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -45,7 +47,7 @@ repositories {
45
47
 
46
48
 
47
49
  dependencies {
48
- implementation 'com.android.support:appcompat-v7:XX.X.+'
50
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
49
51
  implementation fileTree(dir: 'libs', include: ['*.jar'])
50
52
  implementation project(':capacitor-android')
51
53
  testImplementation "junit:junit:$junitVersion"
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
4
4
  networkTimeout=10000
5
5
  zipStoreBase=GRADLE_USER_HOME
6
6
  zipStorePath=wrapper/dists
@@ -18,4 +18,3 @@ org.gradle.jvmargs=-Xmx1536m
18
18
 
19
19
  # Supports AndroidX
20
20
  android.useAndroidX=true
21
- android.enableJetifier=true
package/android/gradlew CHANGED
@@ -85,9 +85,6 @@ done
85
85
  APP_BASE_NAME=${0##*/}
86
86
  APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87
87
 
88
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89
- DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90
-
91
88
  # Use the maximum available, or set MAX_FD != -1 to use that value.
92
89
  MAX_FD=maximum
93
90
 
@@ -144,7 +141,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144
141
  case $MAX_FD in #(
145
142
  max*)
146
143
  # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147
- # shellcheck disable=SC3045
144
+ # shellcheck disable=SC3045
148
145
  MAX_FD=$( ulimit -H -n ) ||
149
146
  warn "Could not query maximum file descriptor limit"
150
147
  esac
@@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
152
149
  '' | soft) :;; #(
153
150
  *)
154
151
  # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155
- # shellcheck disable=SC3045
152
+ # shellcheck disable=SC3045
156
153
  ulimit -n "$MAX_FD" ||
157
154
  warn "Could not set maximum file descriptor limit to $MAX_FD"
158
155
  esac
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
197
194
  done
198
195
  fi
199
196
 
197
+
198
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199
+ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200
+
200
201
  # Collect all arguments for the java command;
201
202
  # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202
203
  # shell script including quotes and variable substitutions, so put them in
@@ -16,11 +16,13 @@ import org.junit.runner.RunWith;
16
16
  @RunWith(AndroidJUnit4.class)
17
17
  public class ExampleInstrumentedTest {
18
18
 
19
- @Test
20
- public void useAppContext() throws Exception {
21
- // Context of the app under test.
22
- Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
19
+ @Test
20
+ public void useAppContext() throws Exception {
21
+ // Context of the app under test.
22
+ Context appContext = InstrumentationRegistry
23
+ .getInstrumentation()
24
+ .getTargetContext();
23
25
 
24
- assertEquals("com.getcapacitor.android", appContext.getPackageName());
25
- }
26
+ assertEquals("com.getcapacitor.android", appContext.getPackageName());
27
+ }
26
28
  }
@@ -1,5 +1,5 @@
1
1
 
2
2
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="com.getcapacitor.community.nativemarket.nativemarket">
3
+ >
4
4
  </manifest>
5
5
 
@@ -12,106 +12,120 @@ import com.getcapacitor.annotation.CapacitorPlugin;
12
12
  @CapacitorPlugin(name = "NativeMarket")
13
13
  public class NativeMarket extends Plugin {
14
14
 
15
- @PluginMethod
16
- public void openStoreListing(PluginCall call) {
17
- try {
18
- if (call.hasOption("appId")) {
19
- String appId = call.getString("appId");
20
-
21
- Context context = this.bridge.getActivity().getApplicationContext();
22
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appId));
23
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
24
- context.startActivity(intent);
25
-
26
- call.resolve();
27
- } else {
28
- call.reject("appId is missing");
29
- }
30
- } catch (Exception ex) {
31
- call.error(ex.getLocalizedMessage());
32
- }
15
+ @PluginMethod
16
+ public void openStoreListing(PluginCall call) {
17
+ try {
18
+ if (call.hasOption("appId")) {
19
+ String appId = call.getString("appId");
20
+
21
+ Context context = this.bridge.getActivity().getApplicationContext();
22
+ Intent intent = new Intent(
23
+ Intent.ACTION_VIEW,
24
+ Uri.parse("market://details?id=" + appId)
25
+ );
26
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
27
+ context.startActivity(intent);
28
+
29
+ call.resolve();
30
+ } else {
31
+ call.reject("appId is missing");
32
+ }
33
+ } catch (Exception ex) {
34
+ call.error(ex.getLocalizedMessage());
33
35
  }
34
-
35
- @PluginMethod
36
- public void openDevPage(PluginCall call) {
37
- try {
38
- if (call.hasOption("devId")) {
39
- String devId = call.getString("devId");
40
-
41
- Context context = this.getContext();
42
- Intent intent = new Intent(Intent.ACTION_VIEW);
43
- intent.setData(Uri.parse("https://play.google.com/store/apps/dev?id=" + devId));
44
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
45
- context.startActivity(intent);
46
-
47
- call.resolve();
48
- } else {
49
- call.reject("devId is missing");
50
- }
51
- } catch (Exception ex) {
52
- call.error(ex.getLocalizedMessage());
53
- }
36
+ }
37
+
38
+ @PluginMethod
39
+ public void openDevPage(PluginCall call) {
40
+ try {
41
+ if (call.hasOption("devId")) {
42
+ String devId = call.getString("devId");
43
+
44
+ Context context = this.getContext();
45
+ Intent intent = new Intent(Intent.ACTION_VIEW);
46
+ intent.setData(
47
+ Uri.parse("https://play.google.com/store/apps/dev?id=" + devId)
48
+ );
49
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
50
+ context.startActivity(intent);
51
+
52
+ call.resolve();
53
+ } else {
54
+ call.reject("devId is missing");
55
+ }
56
+ } catch (Exception ex) {
57
+ call.error(ex.getLocalizedMessage());
54
58
  }
55
-
56
- @PluginMethod
57
- public void openCollection(PluginCall call) {
58
- try {
59
- if (call.hasOption("name")) {
60
- String name = call.getString("name");
61
-
62
- Context context = this.getContext();
63
- Intent intent = new Intent(Intent.ACTION_VIEW);
64
- intent.setData(Uri.parse("https://play.google.com/store/apps/collection/" + name));
65
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
66
- context.startActivity(intent);
67
-
68
- call.resolve();
69
- } else {
70
- call.reject("name is missing");
71
- }
72
- } catch (Exception ex) {
73
- call.error(ex.getLocalizedMessage());
74
- }
59
+ }
60
+
61
+ @PluginMethod
62
+ public void openCollection(PluginCall call) {
63
+ try {
64
+ if (call.hasOption("name")) {
65
+ String name = call.getString("name");
66
+
67
+ Context context = this.getContext();
68
+ Intent intent = new Intent(Intent.ACTION_VIEW);
69
+ intent.setData(
70
+ Uri.parse("https://play.google.com/store/apps/collection/" + name)
71
+ );
72
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
73
+ context.startActivity(intent);
74
+
75
+ call.resolve();
76
+ } else {
77
+ call.reject("name is missing");
78
+ }
79
+ } catch (Exception ex) {
80
+ call.error(ex.getLocalizedMessage());
75
81
  }
76
-
77
- @PluginMethod
78
- public void openEditorChoicePage(PluginCall call) {
79
- try {
80
- if (call.hasOption("editorChoice")) {
81
- String editorChoice = call.getString("editorChoice");
82
-
83
- Context context = this.getContext();
84
- Intent intent = new Intent(Intent.ACTION_VIEW);
85
- intent.setData(Uri.parse("https://play.google.com/store/apps/topic?id=" + editorChoice));
86
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
87
- context.startActivity(intent);
88
-
89
- call.resolve();
90
- } else {
91
- call.reject("editorChoice is missing");
92
- }
93
- } catch (Exception ex) {
94
- call.error(ex.getLocalizedMessage());
95
- }
82
+ }
83
+
84
+ @PluginMethod
85
+ public void openEditorChoicePage(PluginCall call) {
86
+ try {
87
+ if (call.hasOption("editorChoice")) {
88
+ String editorChoice = call.getString("editorChoice");
89
+
90
+ Context context = this.getContext();
91
+ Intent intent = new Intent(Intent.ACTION_VIEW);
92
+ intent.setData(
93
+ Uri.parse(
94
+ "https://play.google.com/store/apps/topic?id=" + editorChoice
95
+ )
96
+ );
97
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
98
+ context.startActivity(intent);
99
+
100
+ call.resolve();
101
+ } else {
102
+ call.reject("editorChoice is missing");
103
+ }
104
+ } catch (Exception ex) {
105
+ call.error(ex.getLocalizedMessage());
96
106
  }
97
-
98
- @PluginMethod
99
- public void search(PluginCall call) {
100
- try {
101
- if (call.hasOption("terms")) {
102
- String terms = call.getString("terms");
103
-
104
- Context context = this.getContext();
105
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=" + terms));
106
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
107
- context.startActivity(intent);
108
-
109
- call.resolve();
110
- } else {
111
- call.reject("terms is missing");
112
- }
113
- } catch (Exception ex) {
114
- call.error(ex.getLocalizedMessage());
115
- }
107
+ }
108
+
109
+ @PluginMethod
110
+ public void search(PluginCall call) {
111
+ try {
112
+ if (call.hasOption("terms")) {
113
+ String terms = call.getString("terms");
114
+
115
+ Context context = this.getContext();
116
+ Intent intent = new Intent(
117
+ Intent.ACTION_VIEW,
118
+ Uri.parse("market://search?q=" + terms)
119
+ );
120
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
121
+ context.startActivity(intent);
122
+
123
+ call.resolve();
124
+ } else {
125
+ call.reject("terms is missing");
126
+ }
127
+ } catch (Exception ex) {
128
+ call.error(ex.getLocalizedMessage());
116
129
  }
130
+ }
117
131
  }
@@ -11,8 +11,8 @@ import org.junit.Test;
11
11
  */
12
12
  public class ExampleUnitTest {
13
13
 
14
- @Test
15
- public void addition_isCorrect() throws Exception {
16
- assertEquals(4, 2 + 2);
17
- }
14
+ @Test
15
+ public void addition_isCorrect() throws Exception {
16
+ assertEquals(4, 2 + 2);
17
+ }
18
18
  }
@@ -1,4 +1,4 @@
1
- import type { NativeMarketPlugin } from './definitions';
1
+ import type { NativeMarketPlugin } from "./definitions";
2
2
  declare const NativeMarket: NativeMarketPlugin;
3
- export * from './definitions';
3
+ export * from "./definitions";
4
4
  export { NativeMarket };
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { registerPlugin } from '@capacitor/core';
2
- const NativeMarket = registerPlugin('NativeMarket', {
3
- web: () => import('./web').then((m) => new m.NativeMarketWeb()),
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 './definitions';
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 '@capacitor/core';
2
- import type { NativeMarketPlugin } from './definitions';
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 '@capacitor/core';
1
+ import { WebPlugin } from "@capacitor/core";
2
2
  export class NativeMarketWeb extends WebPlugin {
3
3
  openStoreListing(_options) {
4
- throw new Error('Method not implemented.');
4
+ throw new Error("Method not implemented.");
5
5
  }
6
6
  openDevPage(_options) {
7
- throw new Error('Method not implemented.');
7
+ throw new Error("Method not implemented.");
8
8
  }
9
9
  openCollection(_options) {
10
- throw new Error('Method not implemented.');
10
+ throw new Error("Method not implemented.");
11
11
  }
12
12
  openEditorChoicePage(_options) {
13
- throw new Error('Method not implemented.');
13
+ throw new Error("Method not implemented.");
14
14
  }
15
15
  search(_options) {
16
- throw new Error('Method not implemented.');
16
+ throw new Error("Method not implemented.");
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,QAA6C;QAC5D,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,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"}
@@ -2,25 +2,25 @@
2
2
 
3
3
  var core = require('@capacitor/core');
4
4
 
5
- const NativeMarket = core.registerPlugin('NativeMarket', {
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('Method not implemented.');
11
+ throw new Error("Method not implemented.");
12
12
  }
13
13
  openDevPage(_options) {
14
- throw new Error('Method not implemented.');
14
+ throw new Error("Method not implemented.");
15
15
  }
16
16
  openCollection(_options) {
17
- throw new Error('Method not implemented.');
17
+ throw new Error("Method not implemented.");
18
18
  }
19
19
  openEditorChoicePage(_options) {
20
- throw new Error('Method not implemented.');
20
+ throw new Error("Method not implemented.");
21
21
  }
22
22
  search(_options) {
23
- throw new Error('Method not implemented.');
23
+ throw new Error("Method not implemented.");
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.\");\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;;;;;;;;;"}
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('NativeMarket', {
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('Method not implemented.');
10
+ throw new Error("Method not implemented.");
11
11
  }
12
12
  openDevPage(_options) {
13
- throw new Error('Method not implemented.');
13
+ throw new Error("Method not implemented.");
14
14
  }
15
15
  openCollection(_options) {
16
- throw new Error('Method not implemented.');
16
+ throw new Error("Method not implemented.");
17
17
  }
18
18
  openEditorChoicePage(_options) {
19
- throw new Error('Method not implemented.');
19
+ throw new Error("Method not implemented.");
20
20
  }
21
21
  search(_options) {
22
- throw new Error('Method not implemented.');
22
+ throw new Error("Method not implemented.");
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.\");\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;;;;;;;;;;;;;;;"}
@@ -5,7 +5,7 @@ struct APIResult: Codable {
5
5
  struct App: Codable {
6
6
  let trackId: Int
7
7
 
8
- enum CodingKeys : String, CodingKey {
8
+ enum CodingKeys: String, CodingKey {
9
9
  case trackId
10
10
  }
11
11
  }
@@ -13,7 +13,7 @@ struct APIResult: Codable {
13
13
  let resultCount: Int
14
14
  let apps: [App]
15
15
 
16
- enum CodingKeys : String, CodingKey {
16
+ enum CodingKeys: String, CodingKey {
17
17
  case resultCount
18
18
  case apps = "results"
19
19
  }
@@ -25,7 +25,7 @@ struct APIResult: Codable {
25
25
  */
26
26
  @objc(NativeMarket)
27
27
  public class NativeMarket: CAPPlugin {
28
-
28
+
29
29
  @objc func openStoreListing(_ call: CAPPluginCall) {
30
30
  guard let appId = call.getString("appId") else {
31
31
  call.reject("appId is missing")
@@ -39,11 +39,11 @@ public class NativeMarket: CAPPlugin {
39
39
  let apps = try! decoder.decode(APIResult.self, from: data).apps
40
40
  let urlStore = "itms-apps://itunes.apple.com/app/id\(apps[0].trackId)"
41
41
  let appUrl = URL(string: urlStore)
42
-
42
+
43
43
  DispatchQueue.main.async {
44
44
  if UIApplication.shared.canOpenURL(appUrl!) {
45
45
  if #available(iOS 10.0, *) {
46
- UIApplication.shared.open(appUrl!, options: [:]) { (success) in
46
+ UIApplication.shared.open(appUrl!, options: [:]) { (_) in
47
47
  call.resolve()
48
48
  }
49
49
  } else {
@@ -57,29 +57,29 @@ public class NativeMarket: CAPPlugin {
57
57
  call.reject("trackId cannot be found from appId")
58
58
  }
59
59
  }
60
-
60
+
61
61
  @objc func openDevPage(_ call: CAPPluginCall) {
62
62
  call.resolve() // TODO: Implement
63
63
  }
64
-
64
+
65
65
  @objc func openCollection(_ call: CAPPluginCall) {
66
66
  call.resolve() // TODO: Implement
67
67
  }
68
-
68
+
69
69
  @objc func openEditorChoicePage(_ call: CAPPluginCall) {
70
70
  call.resolve() // TODO: Implement
71
71
  }
72
-
72
+
73
73
  @objc func search(_ call: CAPPluginCall) {
74
74
  if call.hasOption("terms") {
75
75
  let terms = call.getString("terms")
76
-
76
+
77
77
  let url = "itms-apps://itunes.apple.com/search?term=" + terms!
78
78
  let appUrl = URL(string: url)
79
-
79
+
80
80
  if UIApplication.shared.canOpenURL(appUrl!) {
81
81
  if #available(iOS 10.0, *) {
82
- UIApplication.shared.open(appUrl!, options: [:]) { (success) in
82
+ UIApplication.shared.open(appUrl!, options: [:]) { (_) in
83
83
  call.resolve()
84
84
  }
85
85
  } else {
@@ -3,33 +3,33 @@ import Capacitor
3
3
  @testable import Plugin
4
4
 
5
5
  class PluginTests: XCTestCase {
6
-
6
+
7
7
  override func setUp() {
8
8
  super.setUp()
9
9
  // Put setup code here. This method is called before the invocation of each test method in the class.
10
10
  }
11
-
11
+
12
12
  override func tearDown() {
13
13
  // Put teardown code here. This method is called after the invocation of each test method in the class.
14
14
  super.tearDown()
15
15
  }
16
-
16
+
17
17
  func testEcho() {
18
18
  // This is an example of a functional test case for a plugin.
19
19
  // Use XCTAssert and related functions to verify your tests produce the correct results.
20
-
20
+
21
21
  let value = "Hello, World!"
22
22
  let plugin = MyPlugin()
23
-
23
+
24
24
  let call = CAPPluginCall(callbackId: "test", options: [
25
25
  "value": value
26
- ], success: { (result, call) in
26
+ ], success: { (result, _) in
27
27
  let resultValue = result!.data["value"] as? String
28
28
  XCTAssertEqual(value, resultValue)
29
- }, error: { (err) in
29
+ }, error: { (_) in
30
30
  XCTFail("Error shouldn't have been called")
31
31
  })
32
-
32
+
33
33
  plugin.echo(call!)
34
34
  }
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-market",
3
- "version": "1.1.36",
3
+ "version": "5.0.2",
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",
@@ -11,42 +11,41 @@
11
11
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
12
12
  "verify:web": "npm run build",
13
13
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
14
- "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format",
14
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --autocorrect --format",
15
15
  "eslint": "eslint . --ext ts",
16
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
16
+ "prettier": "prettier --config .prettierrc.js \"**/*.{css,html,ts,js,java}\"",
17
17
  "swiftlint": "node-swiftlint",
18
18
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
19
19
  "clean": "rimraf ./dist",
20
20
  "watch": "tsc --watch",
21
21
  "docgen": "docgen --api NativeMarketPlugin --output-readme README.md --output-json dist/docs.json",
22
- "prepublishOnly": "npm run build",
23
- "prepare": "husky install"
22
+ "prepublishOnly": "npm run build"
24
23
  },
25
24
  "author": "Martin Donadieu <martindonadieu@gmail.com>",
26
25
  "license": "MIT",
27
26
  "dependencies": {
28
- "@capacitor/core": "^4.4.0"
27
+ "@capacitor/core": "^5.0.3"
29
28
  },
30
29
  "devDependencies": {
31
- "@capacitor/android": "^4.4.0",
32
- "@capacitor/cli": "^4.4.0",
33
- "@capacitor/core": "^4.4.0",
34
- "@capacitor/docgen": "^0.2.0",
35
- "@capacitor/ios": "^4.4.0",
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",
36
35
  "@ionic/eslint-config": "^0.3.0",
37
- "@ionic/prettier-config": "^2.0.0",
36
+ "@ionic/prettier-config": "^3.0.0",
38
37
  "@ionic/swiftlint-config": "^1.1.2",
39
- "@typescript-eslint/eslint-plugin": "^5.42.1",
40
- "@typescript-eslint/parser": "^5.42.1",
41
- "eslint": "^8.27.0",
42
- "eslint-plugin-import": "^2.26.0",
43
- "husky": "^8.0.2",
44
- "prettier": "^2.7.1",
45
- "prettier-plugin-java": "^2.0.0",
46
- "rimraf": "^3.0.2",
47
- "rollup": "^3.0.0",
48
- "swiftlint": "^1.0.1",
49
- "typescript": "^4.8.4"
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"
50
49
  },
51
50
  "files": [
52
51
  "dist/",