@capgo/native-market 1.1.11 → 1.1.13

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
@@ -57,15 +57,17 @@ No configuration required for this plugin
57
57
  ## Usage
58
58
 
59
59
  ```typescript
60
- import { NativeMarket } from "@capgo/native-market";
60
+ import { NativeMarket } from '@capgo/native-market';
61
61
 
62
62
  /**
63
63
  * This method will launch link in Play/App Store.
64
64
  * @param appId - ID of your application. Eg. com.example.app
65
+ * @param [country] - International country code if application is not published in the US App store (only for iOS). Eg. IT
65
66
  * @returns void
66
67
  */
67
68
  NativeMarket.openStoreListing({
68
- appId: "com.example.app",
69
+ appId: 'com.example.app',
70
+ country: 'IT',
69
71
  });
70
72
 
71
73
  /**
@@ -74,7 +76,7 @@ NativeMarket.openStoreListing({
74
76
  * @returns void
75
77
  */
76
78
  NativeMarket.openDevPage({
77
- devId: "5700313618786177705",
79
+ devId: '5700313618786177705',
78
80
  });
79
81
 
80
82
  /**
@@ -83,7 +85,7 @@ NativeMarket.openDevPage({
83
85
  * @returns void
84
86
  */
85
87
  NativeMarket.openCollection({
86
- name: "featured",
88
+ name: 'featured',
87
89
  });
88
90
 
89
91
  /**
@@ -92,7 +94,7 @@ NativeMarket.openCollection({
92
94
  * @returns void
93
95
  */
94
96
  NativeMarket.openEditorChoicePage({
95
- editorChoice: "editorial_fitness_apps_us",
97
+ editorChoice: 'editorial_fitness_apps_us',
96
98
  });
97
99
 
98
100
  /**
@@ -101,7 +103,7 @@ NativeMarket.openEditorChoicePage({
101
103
  * @returns void
102
104
  */
103
105
  NativeMarket.search({
104
- terms: "capacitor",
106
+ terms: 'capacitor',
105
107
  });
106
108
  ```
107
109
 
@@ -111,14 +113,14 @@ NativeMarket.search({
111
113
  ### openStoreListing(...)
112
114
 
113
115
  ```typescript
114
- openStoreListing(options: { appId: string; }) => Promise<void>
116
+ openStoreListing(options: { appId: string; country?: string; }) => Promise<void>
115
117
  ```
116
118
 
117
119
  This method will launch link in Play/App Store.
118
120
 
119
- | Param | Type |
120
- | ------------- | ------------------------------- |
121
- | **`options`** | <code>{ appId: string; }</code> |
121
+ | Param | Type |
122
+ | ------------- | ------------------------------------------------- |
123
+ | **`options`** | <code>{ appId: string; country?: string; }</code> |
122
124
 
123
125
  **Since:** 1.0.0
124
126
 
@@ -200,3 +202,7 @@ Only in Android.
200
202
  --------------------
201
203
 
202
204
  </docgen-api>
205
+
206
+ ## iOS Notes
207
+
208
+ If your app is not published in the US App Store, you might not be able to find it. In this case you must specify country code for lookup search to work.
package/dist/docs.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "methods": [
8
8
  {
9
9
  "name": "openStoreListing",
10
- "signature": "(options: { appId: string; }) => Promise<void>",
10
+ "signature": "(options: { appId: string; country?: string; }) => Promise<void>",
11
11
  "parameters": [
12
12
  {
13
13
  "name": "options",
14
14
  "docs": "",
15
- "type": "{ appId: string; }"
15
+ "type": "{ appId: string; country?: string | undefined; }"
16
16
  }
17
17
  ],
18
18
  "returns": "Promise<void>",
@@ -21,6 +21,10 @@
21
21
  "name": "param",
22
22
  "text": "appId - ID of your application. Eg. com.example.app"
23
23
  },
24
+ {
25
+ "name": "param",
26
+ "text": "country - International country code if application is not published in the US App store (only for iOS). Eg. IT"
27
+ },
24
28
  {
25
29
  "name": "returns",
26
30
  "text": "void"
@@ -3,6 +3,7 @@ export interface NativeMarketPlugin {
3
3
  * This method will launch link in Play/App Store.
4
4
  *
5
5
  * @param {String} appId - ID of your application. Eg. com.example.app
6
+ * @param {String} [country] - International country code if application is not published in the US App store (only for iOS). Eg. IT
6
7
  *
7
8
  * @returns void
8
9
  *
@@ -10,6 +11,7 @@ export interface NativeMarketPlugin {
10
11
  */
11
12
  openStoreListing(options: {
12
13
  appId: string;
14
+ country?: string;
13
15
  }): Promise<void>;
14
16
  /**
15
17
  * This method will deep-link directly to an Play/App store listing page.
package/dist/esm/web.d.ts CHANGED
@@ -3,6 +3,7 @@ import type { NativeMarketPlugin } from './definitions';
3
3
  export declare class NativeMarketWeb extends WebPlugin implements NativeMarketPlugin {
4
4
  openStoreListing(_options: {
5
5
  appId: string;
6
+ country?: string;
6
7
  }): Promise<void>;
7
8
  openDevPage(_options: {
8
9
  devId: string;
@@ -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,QAA2B;QAC1C,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,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"}
@@ -31,8 +31,9 @@ public class NativeMarket: CAPPlugin {
31
31
  call.reject("appId is missing")
32
32
  return
33
33
  }
34
+ let country = call.getString("country") ?? ""
34
35
  do {
35
- let url = URL(string: "http://itunes.apple.com/lookup?bundleId=\(appId)")
36
+ let url = URL(string: "http://itunes.apple.com/lookup?bundleId=\(appId)&country=\(country)")
36
37
  let data = try Data(contentsOf: url!)
37
38
  let decoder = JSONDecoder()
38
39
  let apps = try! decoder.decode(APIResult.self, from: data).apps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-market",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
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",