@capgo/native-market 1.0.4
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/LICENSE +21 -0
- package/NativeMarket.podspec +13 -0
- package/README.md +196 -0
- package/android/.classpath +6 -0
- package/android/android.iml +109 -0
- package/android/build.gradle +55 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/android/gradle.properties +21 -0
- package/android/gradlew +160 -0
- package/android/gradlew.bat +90 -0
- package/android/proguard-rules.pro +21 -0
- package/android/settings.gradle +2 -0
- package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +27 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/getcapacitor/community/nativemarket/NativeMarket.java +131 -0
- package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
- package/android/src/main/res/values/colors.xml +3 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +3 -0
- package/android/src/test/java/com/getcapacitor/ExampleUnitTest.java +17 -0
- package/dist/docs.json +160 -0
- package/dist/esm/definitions.d.ts +67 -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 +19 -0
- package/dist/esm/web.js +19 -0
- package/dist/esm/web.js.map +1 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Plugin.h +10 -0
- package/ios/Plugin/Plugin.m +12 -0
- package/ios/Plugin/Plugin.swift +68 -0
- package/ios/Plugin.xcodeproj/project.pbxproj +556 -0
- package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/PluginTests/Info.plist +22 -0
- package/ios/PluginTests/PluginTests.swift +35 -0
- package/ios/Podfile +16 -0
- package/package.json +66 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@if "%DEBUG%" == "" @echo off
|
|
2
|
+
@rem ##########################################################################
|
|
3
|
+
@rem
|
|
4
|
+
@rem Gradle startup script for Windows
|
|
5
|
+
@rem
|
|
6
|
+
@rem ##########################################################################
|
|
7
|
+
|
|
8
|
+
@rem Set local scope for the variables with windows NT shell
|
|
9
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
10
|
+
|
|
11
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
12
|
+
set DEFAULT_JVM_OPTS=
|
|
13
|
+
|
|
14
|
+
set DIRNAME=%~dp0
|
|
15
|
+
if "%DIRNAME%" == "" set DIRNAME=.
|
|
16
|
+
set APP_BASE_NAME=%~n0
|
|
17
|
+
set APP_HOME=%DIRNAME%
|
|
18
|
+
|
|
19
|
+
@rem Find java.exe
|
|
20
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
21
|
+
|
|
22
|
+
set JAVA_EXE=java.exe
|
|
23
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
24
|
+
if "%ERRORLEVEL%" == "0" goto init
|
|
25
|
+
|
|
26
|
+
echo.
|
|
27
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
28
|
+
echo.
|
|
29
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
30
|
+
echo location of your Java installation.
|
|
31
|
+
|
|
32
|
+
goto fail
|
|
33
|
+
|
|
34
|
+
:findJavaFromJavaHome
|
|
35
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
36
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
37
|
+
|
|
38
|
+
if exist "%JAVA_EXE%" goto init
|
|
39
|
+
|
|
40
|
+
echo.
|
|
41
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
42
|
+
echo.
|
|
43
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
44
|
+
echo location of your Java installation.
|
|
45
|
+
|
|
46
|
+
goto fail
|
|
47
|
+
|
|
48
|
+
:init
|
|
49
|
+
@rem Get command-line arguments, handling Windowz variants
|
|
50
|
+
|
|
51
|
+
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
52
|
+
if "%@eval[2+2]" == "4" goto 4NT_args
|
|
53
|
+
|
|
54
|
+
:win9xME_args
|
|
55
|
+
@rem Slurp the command line arguments.
|
|
56
|
+
set CMD_LINE_ARGS=
|
|
57
|
+
set _SKIP=2
|
|
58
|
+
|
|
59
|
+
:win9xME_args_slurp
|
|
60
|
+
if "x%~1" == "x" goto execute
|
|
61
|
+
|
|
62
|
+
set CMD_LINE_ARGS=%*
|
|
63
|
+
goto execute
|
|
64
|
+
|
|
65
|
+
:4NT_args
|
|
66
|
+
@rem Get arguments from the 4NT Shell from JP Software
|
|
67
|
+
set CMD_LINE_ARGS=%$
|
|
68
|
+
|
|
69
|
+
:execute
|
|
70
|
+
@rem Setup the command line
|
|
71
|
+
|
|
72
|
+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
73
|
+
|
|
74
|
+
@rem Execute Gradle
|
|
75
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
76
|
+
|
|
77
|
+
:end
|
|
78
|
+
@rem End local scope for the variables with windows NT shell
|
|
79
|
+
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
80
|
+
|
|
81
|
+
:fail
|
|
82
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
83
|
+
rem the _cmd.exe /c_ return code!
|
|
84
|
+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
85
|
+
exit /b 1
|
|
86
|
+
|
|
87
|
+
:mainEnd
|
|
88
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
89
|
+
|
|
90
|
+
:omega
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package com.getcapacitor.android;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
|
|
5
|
+
import androidx.test.platform.app.InstrumentationRegistry;
|
|
6
|
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
7
|
+
|
|
8
|
+
import org.junit.Test;
|
|
9
|
+
import org.junit.runner.RunWith;
|
|
10
|
+
|
|
11
|
+
import static org.junit.Assert.*;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Instrumented test, which will execute on an Android device.
|
|
15
|
+
*
|
|
16
|
+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
17
|
+
*/
|
|
18
|
+
@RunWith(AndroidJUnit4.class)
|
|
19
|
+
public class ExampleInstrumentedTest {
|
|
20
|
+
@Test
|
|
21
|
+
public void useAppContext() throws Exception {
|
|
22
|
+
// Context of the app under test.
|
|
23
|
+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
24
|
+
|
|
25
|
+
assertEquals("com.getcapacitor.android", appContext.getPackageName());
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
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.NativePlugin;
|
|
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
|
+
@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());
|
|
35
|
+
}
|
|
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());
|
|
58
|
+
}
|
|
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());
|
|
81
|
+
}
|
|
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());
|
|
106
|
+
}
|
|
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());
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
+
android:layout_width="match_parent"
|
|
6
|
+
android:layout_height="match_parent"
|
|
7
|
+
tools:context="com.getcapacitor.BridgeActivity"
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
<WebView
|
|
11
|
+
android:id="@+id/webview"
|
|
12
|
+
android:layout_width="fill_parent"
|
|
13
|
+
android:layout_height="fill_parent" />
|
|
14
|
+
|
|
15
|
+
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.getcapacitor;
|
|
2
|
+
|
|
3
|
+
import org.junit.Test;
|
|
4
|
+
|
|
5
|
+
import static org.junit.Assert.*;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Example local unit test, which will execute on the development machine (host).
|
|
9
|
+
*
|
|
10
|
+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
11
|
+
*/
|
|
12
|
+
public class ExampleUnitTest {
|
|
13
|
+
@Test
|
|
14
|
+
public void addition_isCorrect() throws Exception {
|
|
15
|
+
assertEquals(4, 2 + 2);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "NativeMarketPlugin",
|
|
4
|
+
"slug": "nativemarketplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "openStoreListing",
|
|
10
|
+
"signature": "(options: { appId: string; }) => Promise<void>",
|
|
11
|
+
"parameters": [
|
|
12
|
+
{
|
|
13
|
+
"name": "options",
|
|
14
|
+
"docs": "",
|
|
15
|
+
"type": "{ appId: string; }"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"returns": "Promise<void>",
|
|
19
|
+
"tags": [
|
|
20
|
+
{
|
|
21
|
+
"name": "param",
|
|
22
|
+
"text": "appId - ID of your application. Eg. com.example.app"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "returns",
|
|
26
|
+
"text": "void"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "since",
|
|
30
|
+
"text": "1.0.0"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"docs": "This method will launch link in Play/App Store.",
|
|
34
|
+
"complexTypes": [],
|
|
35
|
+
"slug": "openstorelisting"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "openDevPage",
|
|
39
|
+
"signature": "(options: { devId: string; }) => Promise<void>",
|
|
40
|
+
"parameters": [
|
|
41
|
+
{
|
|
42
|
+
"name": "options",
|
|
43
|
+
"docs": "",
|
|
44
|
+
"type": "{ devId: string; }"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"returns": "Promise<void>",
|
|
48
|
+
"tags": [
|
|
49
|
+
{
|
|
50
|
+
"name": "param",
|
|
51
|
+
"text": "devId - ID of developer. Eg. com.example.app"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "returns",
|
|
55
|
+
"text": "void"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "since",
|
|
59
|
+
"text": "1.0.0"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"docs": "This method will deep-link directly to an Play/App store listing page.\n\nOnly in Android.",
|
|
63
|
+
"complexTypes": [],
|
|
64
|
+
"slug": "opendevpage"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "openCollection",
|
|
68
|
+
"signature": "(options: { name: string; }) => Promise<void>",
|
|
69
|
+
"parameters": [
|
|
70
|
+
{
|
|
71
|
+
"name": "options",
|
|
72
|
+
"docs": "",
|
|
73
|
+
"type": "{ name: string; }"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"returns": "Promise<void>",
|
|
77
|
+
"tags": [
|
|
78
|
+
{
|
|
79
|
+
"name": "param",
|
|
80
|
+
"text": "name - name of the collection. Click [here](https://developer.android.com/distribute/marketing-tools/linking-to-google-play#OpeningCollection) for android options."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "returns",
|
|
84
|
+
"text": "void"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "since",
|
|
88
|
+
"text": "1.0.0"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"docs": "This method will link users to a collection or top charts.\nOnly in Android.",
|
|
92
|
+
"complexTypes": [],
|
|
93
|
+
"slug": "opencollection"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "openEditorChoicePage",
|
|
97
|
+
"signature": "(options: { editorChoice: string; }) => Promise<void>",
|
|
98
|
+
"parameters": [
|
|
99
|
+
{
|
|
100
|
+
"name": "options",
|
|
101
|
+
"docs": "",
|
|
102
|
+
"type": "{ editorChoice: string; }"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"returns": "Promise<void>",
|
|
106
|
+
"tags": [
|
|
107
|
+
{
|
|
108
|
+
"name": "param",
|
|
109
|
+
"text": "editorChoice - ID of your application. Eg. editorial_fitness_apps_us"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "returns",
|
|
113
|
+
"text": "void"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "since",
|
|
117
|
+
"text": "1.0.0"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"docs": "This method will link users to Editor's choice page.\n\nOnly in Android.",
|
|
121
|
+
"complexTypes": [],
|
|
122
|
+
"slug": "openeditorchoicepage"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "search",
|
|
126
|
+
"signature": "(options: { terms: string; }) => Promise<void>",
|
|
127
|
+
"parameters": [
|
|
128
|
+
{
|
|
129
|
+
"name": "options",
|
|
130
|
+
"docs": "",
|
|
131
|
+
"type": "{ terms: string; }"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"returns": "Promise<void>",
|
|
135
|
+
"tags": [
|
|
136
|
+
{
|
|
137
|
+
"name": "param",
|
|
138
|
+
"text": "editorChoice - terms to be searched in Play/App store."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "returns",
|
|
142
|
+
"text": "void"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "since",
|
|
146
|
+
"text": "1.0.0"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"docs": "This method will link users to custom search query.\n\nOnly in Android.",
|
|
150
|
+
"complexTypes": [],
|
|
151
|
+
"slug": "search"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"properties": []
|
|
155
|
+
},
|
|
156
|
+
"interfaces": [],
|
|
157
|
+
"enums": [],
|
|
158
|
+
"typeAliases": [],
|
|
159
|
+
"pluginConfigs": []
|
|
160
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface NativeMarketPlugin {
|
|
2
|
+
/**
|
|
3
|
+
* This method will launch link in Play/App Store.
|
|
4
|
+
*
|
|
5
|
+
* @param {String} appId - ID of your application. Eg. com.example.app
|
|
6
|
+
*
|
|
7
|
+
* @returns void
|
|
8
|
+
*
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
openStoreListing(options: {
|
|
12
|
+
appId: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* This method will deep-link directly to an Play/App store listing page.
|
|
16
|
+
*
|
|
17
|
+
* Only in Android.
|
|
18
|
+
*
|
|
19
|
+
* @param {String} devId - ID of developer. Eg. com.example.app
|
|
20
|
+
*
|
|
21
|
+
* @returns void
|
|
22
|
+
*
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
*/
|
|
25
|
+
openDevPage(options: {
|
|
26
|
+
devId: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* This method will link users to a collection or top charts.
|
|
30
|
+
* Only in Android.
|
|
31
|
+
*
|
|
32
|
+
* @param {String} name - name of the collection. Click [here](https://developer.android.com/distribute/marketing-tools/linking-to-google-play#OpeningCollection) for android options.
|
|
33
|
+
*
|
|
34
|
+
* @returns void
|
|
35
|
+
*
|
|
36
|
+
* @since 1.0.0
|
|
37
|
+
*/
|
|
38
|
+
openCollection(options: {
|
|
39
|
+
name: string;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* This method will link users to Editor's choice page.
|
|
43
|
+
*
|
|
44
|
+
* Only in Android.
|
|
45
|
+
*
|
|
46
|
+
* @param {String} editorChoice - ID of your application. Eg. editorial_fitness_apps_us
|
|
47
|
+
* @returns void
|
|
48
|
+
*
|
|
49
|
+
* @since 1.0.0
|
|
50
|
+
*/
|
|
51
|
+
openEditorChoicePage(options: {
|
|
52
|
+
editorChoice: string;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* This method will link users to custom search query.
|
|
56
|
+
*
|
|
57
|
+
* Only in Android.
|
|
58
|
+
*
|
|
59
|
+
* @param {String} editorChoice - terms to be searched in Play/App store.
|
|
60
|
+
* @returns void
|
|
61
|
+
*
|
|
62
|
+
* @since 1.0.0
|
|
63
|
+
*/
|
|
64
|
+
search(options: {
|
|
65
|
+
terms: string;
|
|
66
|
+
}): Promise<void>;
|
|
67
|
+
}
|
|
@@ -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;AAGjD,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,19 @@
|
|
|
1
|
+
import { WebPlugin } from "@capacitor/core";
|
|
2
|
+
import { NativeMarketPlugin } from "./definitions";
|
|
3
|
+
export declare class NativeMarketWeb extends WebPlugin implements NativeMarketPlugin {
|
|
4
|
+
openStoreListing(_options: {
|
|
5
|
+
appId: string;
|
|
6
|
+
}): Promise<void>;
|
|
7
|
+
openDevPage(_options: {
|
|
8
|
+
devId: string;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
openCollection(_options: {
|
|
11
|
+
name: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
openEditorChoicePage(_options: {
|
|
14
|
+
editorChoice: string;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
search(_options: {
|
|
17
|
+
terms: string;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WebPlugin } from "@capacitor/core";
|
|
2
|
+
export class NativeMarketWeb extends WebPlugin {
|
|
3
|
+
openStoreListing(_options) {
|
|
4
|
+
throw new Error("Method not implemented.");
|
|
5
|
+
}
|
|
6
|
+
openDevPage(_options) {
|
|
7
|
+
throw new Error("Method not implemented.");
|
|
8
|
+
}
|
|
9
|
+
openCollection(_options) {
|
|
10
|
+
throw new Error("Method not implemented.");
|
|
11
|
+
}
|
|
12
|
+
openEditorChoicePage(_options) {
|
|
13
|
+
throw new Error("Method not implemented.");
|
|
14
|
+
}
|
|
15
|
+
search(_options) {
|
|
16
|
+
throw new Error("Method not implemented.");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# 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;AAG5C,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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>$(MARKETING_VERSION)</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
+
<key>NSPrincipalClass</key>
|
|
22
|
+
<string></string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
//! Project version number for Plugin.
|
|
4
|
+
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
+
|
|
6
|
+
//! Project version string for Plugin.
|
|
7
|
+
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
+
|
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <Capacitor/Capacitor.h>
|
|
3
|
+
|
|
4
|
+
// Define the plugin using the CAP_PLUGIN Macro, and
|
|
5
|
+
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
|
+
CAP_PLUGIN(NativeMarket, "NativeMarket",
|
|
7
|
+
CAP_PLUGIN_METHOD(openStoreListing, CAPPluginReturnPromise);
|
|
8
|
+
CAP_PLUGIN_METHOD(openDevPage, CAPPluginReturnPromise);
|
|
9
|
+
CAP_PLUGIN_METHOD(openCollection, CAPPluginReturnPromise);
|
|
10
|
+
CAP_PLUGIN_METHOD(openEditorChoicePage, CAPPluginReturnPromise);
|
|
11
|
+
CAP_PLUGIN_METHOD(search, CAPPluginReturnPromise);
|
|
12
|
+
)
|