metamap-capacitor-plugin 1.0.0
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/Avo121MatiCapacitorPlugin.podspec +18 -0
- package/README.md +5 -0
- package/android/build.gradle +57 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +24 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/proguard-rules.pro +21 -0
- package/android/settings.gradle +2 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/com/getmati/plugins/capacitor/MetaMapCapacitorPlugin.java +69 -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 +18 -0
- package/dist/esm/definitions.d.ts +11 -0
- package/dist/esm/definitions.js +1 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/plugin.js +19 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Plugin.h +10 -0
- package/ios/Plugin/Plugin.m +8 -0
- package/ios/Plugin/Plugin.swift +38 -0
- package/ios/Plugin.xcodeproj/project.pbxproj +554 -0
- package/ios/Plugin.xcworkspace/contents.xcworkspacedata +10 -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 +75 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'Avo121MatiCapacitorPlugin'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.homepage = package['repository']['url']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
+
s.ios.deployment_target = '12.0'
|
|
15
|
+
s.dependency 'Capacitor'
|
|
16
|
+
s.dependency 'MetaMap-Global-ID-SDK'
|
|
17
|
+
s.swift_version = '5.1'
|
|
18
|
+
end
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
jcenter()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:4.2.1'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
|
+
android {
|
|
21
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
|
|
22
|
+
defaultConfig {
|
|
23
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
|
|
24
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
|
|
25
|
+
versionCode 1
|
|
26
|
+
versionName "1.0"
|
|
27
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
28
|
+
}
|
|
29
|
+
buildTypes {
|
|
30
|
+
release {
|
|
31
|
+
minifyEnabled false
|
|
32
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
lintOptions {
|
|
36
|
+
abortOnError false
|
|
37
|
+
}
|
|
38
|
+
compileOptions {
|
|
39
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
40
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
repositories {
|
|
45
|
+
google()
|
|
46
|
+
mavenCentral()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
dependencies {
|
|
51
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
52
|
+
implementation project(':capacitor-android')
|
|
53
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
54
|
+
implementation ('com.metamap:android-sdk:3.19.1'){
|
|
55
|
+
exclude group: 'org.json', module: 'json'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Project-wide Gradle settings.
|
|
2
|
+
|
|
3
|
+
# IDE (e.g. Android Studio) users:
|
|
4
|
+
# Gradle settings configured through the IDE *will override*
|
|
5
|
+
# any settings specified in this file.
|
|
6
|
+
|
|
7
|
+
# For more details on how to configure your build environment visit
|
|
8
|
+
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
9
|
+
|
|
10
|
+
# Specifies the JVM arguments used for the daemon process.
|
|
11
|
+
# The setting is particularly useful for tweaking memory settings.
|
|
12
|
+
org.gradle.jvmargs=-Xmx1536m
|
|
13
|
+
|
|
14
|
+
# When configured, Gradle will run in incubating parallel mode.
|
|
15
|
+
# This option should only be used with decoupled projects. More details, visit
|
|
16
|
+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
17
|
+
# org.gradle.parallel=true
|
|
18
|
+
|
|
19
|
+
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
20
|
+
# Android operating system, and which are packaged with your app's APK
|
|
21
|
+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
22
|
+
android.useAndroidX=true
|
|
23
|
+
# Automatically convert third-party libraries to use AndroidX
|
|
24
|
+
android.enableJetifier=true
|
package/android/gradlew
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2015 the original author or authors.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
##############################################################################
|
|
20
|
+
##
|
|
21
|
+
## Gradle start up script for UN*X
|
|
22
|
+
##
|
|
23
|
+
##############################################################################
|
|
24
|
+
|
|
25
|
+
# Attempt to set APP_HOME
|
|
26
|
+
# Resolve links: $0 may be a link
|
|
27
|
+
PRG="$0"
|
|
28
|
+
# Need this for relative symlinks.
|
|
29
|
+
while [ -h "$PRG" ] ; do
|
|
30
|
+
ls=`ls -ld "$PRG"`
|
|
31
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
32
|
+
if expr "$link" : '/.*' > /dev/null; then
|
|
33
|
+
PRG="$link"
|
|
34
|
+
else
|
|
35
|
+
PRG=`dirname "$PRG"`"/$link"
|
|
36
|
+
fi
|
|
37
|
+
done
|
|
38
|
+
SAVED="`pwd`"
|
|
39
|
+
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
40
|
+
APP_HOME="`pwd -P`"
|
|
41
|
+
cd "$SAVED" >/dev/null
|
|
42
|
+
|
|
43
|
+
APP_NAME="Gradle"
|
|
44
|
+
APP_BASE_NAME=`basename "$0"`
|
|
45
|
+
|
|
46
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
47
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
48
|
+
|
|
49
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
50
|
+
MAX_FD="maximum"
|
|
51
|
+
|
|
52
|
+
warn () {
|
|
53
|
+
echo "$*"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
die () {
|
|
57
|
+
echo
|
|
58
|
+
echo "$*"
|
|
59
|
+
echo
|
|
60
|
+
exit 1
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# OS specific support (must be 'true' or 'false').
|
|
64
|
+
cygwin=false
|
|
65
|
+
msys=false
|
|
66
|
+
darwin=false
|
|
67
|
+
nonstop=false
|
|
68
|
+
case "`uname`" in
|
|
69
|
+
CYGWIN* )
|
|
70
|
+
cygwin=true
|
|
71
|
+
;;
|
|
72
|
+
Darwin* )
|
|
73
|
+
darwin=true
|
|
74
|
+
;;
|
|
75
|
+
MINGW* )
|
|
76
|
+
msys=true
|
|
77
|
+
;;
|
|
78
|
+
NONSTOP* )
|
|
79
|
+
nonstop=true
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
|
|
83
|
+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Determine the Java command to use to start the JVM.
|
|
87
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
88
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
89
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
90
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
91
|
+
else
|
|
92
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
|
93
|
+
fi
|
|
94
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
95
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
96
|
+
|
|
97
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
98
|
+
location of your Java installation."
|
|
99
|
+
fi
|
|
100
|
+
else
|
|
101
|
+
JAVACMD="java"
|
|
102
|
+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
103
|
+
|
|
104
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
105
|
+
location of your Java installation."
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Increase the maximum file descriptors if we can.
|
|
109
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
110
|
+
MAX_FD_LIMIT=`ulimit -H -n`
|
|
111
|
+
if [ $? -eq 0 ] ; then
|
|
112
|
+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
113
|
+
MAX_FD="$MAX_FD_LIMIT"
|
|
114
|
+
fi
|
|
115
|
+
ulimit -n $MAX_FD
|
|
116
|
+
if [ $? -ne 0 ] ; then
|
|
117
|
+
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
118
|
+
fi
|
|
119
|
+
else
|
|
120
|
+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
121
|
+
fi
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# For Darwin, add options to specify how the application appears in the dock
|
|
125
|
+
if $darwin; then
|
|
126
|
+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
130
|
+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
131
|
+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
132
|
+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
133
|
+
|
|
134
|
+
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
135
|
+
|
|
136
|
+
# We build the pattern for arguments to be converted via cygpath
|
|
137
|
+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
138
|
+
SEP=""
|
|
139
|
+
for dir in $ROOTDIRSRAW ; do
|
|
140
|
+
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
141
|
+
SEP="|"
|
|
142
|
+
done
|
|
143
|
+
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
144
|
+
# Add a user-defined pattern to the cygpath arguments
|
|
145
|
+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
146
|
+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
147
|
+
fi
|
|
148
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
149
|
+
i=0
|
|
150
|
+
for arg in "$@" ; do
|
|
151
|
+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
152
|
+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
153
|
+
|
|
154
|
+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
155
|
+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
156
|
+
else
|
|
157
|
+
eval `echo args$i`="\"$arg\""
|
|
158
|
+
fi
|
|
159
|
+
i=`expr $i + 1`
|
|
160
|
+
done
|
|
161
|
+
case $i in
|
|
162
|
+
0) set -- ;;
|
|
163
|
+
1) set -- "$args0" ;;
|
|
164
|
+
2) set -- "$args0" "$args1" ;;
|
|
165
|
+
3) set -- "$args0" "$args1" "$args2" ;;
|
|
166
|
+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
167
|
+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
168
|
+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
169
|
+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
170
|
+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
171
|
+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
172
|
+
esac
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# Escape application args
|
|
176
|
+
save () {
|
|
177
|
+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
178
|
+
echo " "
|
|
179
|
+
}
|
|
180
|
+
APP_ARGS=`save "$@"`
|
|
181
|
+
|
|
182
|
+
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
183
|
+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
184
|
+
|
|
185
|
+
exec "$JAVACMD" "$@"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
@rem
|
|
2
|
+
@rem Copyright 2015 the original author or authors.
|
|
3
|
+
@rem
|
|
4
|
+
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
@rem you may not use this file except in compliance with the License.
|
|
6
|
+
@rem You may obtain a copy of the License at
|
|
7
|
+
@rem
|
|
8
|
+
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
@rem
|
|
10
|
+
@rem Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
@rem See the License for the specific language governing permissions and
|
|
14
|
+
@rem limitations under the License.
|
|
15
|
+
@rem
|
|
16
|
+
|
|
17
|
+
@if "%DEBUG%" == "" @echo off
|
|
18
|
+
@rem ##########################################################################
|
|
19
|
+
@rem
|
|
20
|
+
@rem Gradle startup script for Windows
|
|
21
|
+
@rem
|
|
22
|
+
@rem ##########################################################################
|
|
23
|
+
|
|
24
|
+
@rem Set local scope for the variables with windows NT shell
|
|
25
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
26
|
+
|
|
27
|
+
set DIRNAME=%~dp0
|
|
28
|
+
if "%DIRNAME%" == "" set DIRNAME=.
|
|
29
|
+
set APP_BASE_NAME=%~n0
|
|
30
|
+
set APP_HOME=%DIRNAME%
|
|
31
|
+
|
|
32
|
+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
33
|
+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
34
|
+
|
|
35
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
36
|
+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
37
|
+
|
|
38
|
+
@rem Find java.exe
|
|
39
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
40
|
+
|
|
41
|
+
set JAVA_EXE=java.exe
|
|
42
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
43
|
+
if "%ERRORLEVEL%" == "0" goto execute
|
|
44
|
+
|
|
45
|
+
echo.
|
|
46
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
47
|
+
echo.
|
|
48
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
49
|
+
echo location of your Java installation.
|
|
50
|
+
|
|
51
|
+
goto fail
|
|
52
|
+
|
|
53
|
+
:findJavaFromJavaHome
|
|
54
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
55
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
56
|
+
|
|
57
|
+
if exist "%JAVA_EXE%" goto execute
|
|
58
|
+
|
|
59
|
+
echo.
|
|
60
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
61
|
+
echo.
|
|
62
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
63
|
+
echo location of your Java installation.
|
|
64
|
+
|
|
65
|
+
goto fail
|
|
66
|
+
|
|
67
|
+
:execute
|
|
68
|
+
@rem Setup the command line
|
|
69
|
+
|
|
70
|
+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@rem Execute Gradle
|
|
74
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
75
|
+
|
|
76
|
+
:end
|
|
77
|
+
@rem End local scope for the variables with windows NT shell
|
|
78
|
+
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
79
|
+
|
|
80
|
+
:fail
|
|
81
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
82
|
+
rem the _cmd.exe /c_ return code!
|
|
83
|
+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
84
|
+
exit /b 1
|
|
85
|
+
|
|
86
|
+
:mainEnd
|
|
87
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
88
|
+
|
|
89
|
+
: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,11 @@
|
|
|
1
|
+
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
package="io.mati.plugins.capacitor.maticapacitorplugin">
|
|
4
|
+
<application
|
|
5
|
+
android:allowBackup="true"
|
|
6
|
+
android:label="@string/app_name"
|
|
7
|
+
android:supportsRtl="true"
|
|
8
|
+
android:theme="@style/AppTheme">
|
|
9
|
+
</application>
|
|
10
|
+
</manifest>
|
|
11
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
package com.getmati.plugins.capacitor;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.util.Log;
|
|
6
|
+
import androidx.activity.result.ActivityResult;
|
|
7
|
+
import com.getcapacitor.JSObject;
|
|
8
|
+
import com.getcapacitor.Plugin;
|
|
9
|
+
import com.getcapacitor.PluginCall;
|
|
10
|
+
import com.getcapacitor.PluginMethod;
|
|
11
|
+
import com.getcapacitor.annotation.ActivityCallback;
|
|
12
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
13
|
+
import com.metamap.metamap_sdk.MetamapSdk;
|
|
14
|
+
import com.metamap.metamap_sdk.Metadata;
|
|
15
|
+
import org.json.JSONObject;
|
|
16
|
+
import org.json.JSONException;
|
|
17
|
+
|
|
18
|
+
@CapacitorPlugin(name = "MetaMapCapacitor")
|
|
19
|
+
public class MetaMapCapacitorPlugin extends Plugin {
|
|
20
|
+
|
|
21
|
+
@SuppressWarnings("unused")
|
|
22
|
+
@PluginMethod
|
|
23
|
+
public void showMetaMapFlow(PluginCall call) {
|
|
24
|
+
Log.e("MetaMapCapacitorPlugin", "showMetaMapFlow");
|
|
25
|
+
bridge.getActivity().runOnUiThread(new Runnable() {
|
|
26
|
+
@Override
|
|
27
|
+
public void run() {
|
|
28
|
+
|
|
29
|
+
final String clientId = call.getString("clientId");
|
|
30
|
+
final String flowId = call.getString("flowId");
|
|
31
|
+
final JSONObject metadata = call.getObject("metadata", new JSObject());
|
|
32
|
+
try {
|
|
33
|
+
metadata.put("sdkType", "capacitor");
|
|
34
|
+
if (clientId == null) {
|
|
35
|
+
Log.e("MetaMapCapacitorPlugin", "\"Client Id should be not null\"");
|
|
36
|
+
} else {
|
|
37
|
+
Intent flowIntent = MetamapSdk.INSTANCE.createFlowIntent(bridge.getActivity(), clientId, flowId, Metadata.fromJson(metadata.toString(2)));
|
|
38
|
+
startActivityForResult(call, flowIntent, "callback");
|
|
39
|
+
}
|
|
40
|
+
} catch(JSONException excepion) {
|
|
41
|
+
call.reject("Verification failed");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@Override
|
|
48
|
+
protected void handleOnActivityResult(int requestCode, int resultCode, Intent data) {
|
|
49
|
+
super.handleOnActivityResult(requestCode, resultCode, data);
|
|
50
|
+
Log.e("MetaMapCapacitorPlugin", "WILL NOT BE CALLED");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@SuppressWarnings("unused")
|
|
54
|
+
@ActivityCallback
|
|
55
|
+
public void callback(PluginCall call, ActivityResult activityResult) {
|
|
56
|
+
if(activityResult.getResultCode() == Activity.RESULT_OK && activityResult.getData() != null) {
|
|
57
|
+
JSObject result = new JSObject();
|
|
58
|
+
String identityId = activityResult.getData().getStringExtra("ARG_IDENTITY_ID");
|
|
59
|
+
String verificationID = activityResult.getData().getStringExtra("ARG_VERIFICATION_ID");
|
|
60
|
+
result.put("identityId", identityId);
|
|
61
|
+
result.put("verificationID", verificationID);
|
|
62
|
+
call.resolve(result);
|
|
63
|
+
Log.e("MetaMapCapacitorPlugin", "Activity.RESULT_OK");
|
|
64
|
+
} else {
|
|
65
|
+
call.reject("verificationCancelled");
|
|
66
|
+
Log.e("MetaMapCapacitorPlugin", "Activity.RESULT_CANCELLED");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -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,18 @@
|
|
|
1
|
+
package com.getcapacitor;
|
|
2
|
+
|
|
3
|
+
import static org.junit.Assert.*;
|
|
4
|
+
|
|
5
|
+
import org.junit.Test;
|
|
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
|
+
|
|
14
|
+
@Test
|
|
15
|
+
public void addition_isCorrect() throws Exception {
|
|
16
|
+
assertEquals(4, 2 + 2);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MetaMapParams } from './definitions';
|
|
2
|
+
declare const MetaMapCapacitor: {
|
|
3
|
+
showMetaMapFlow: (options: MetaMapParams) => Promise<{
|
|
4
|
+
identityId: string;
|
|
5
|
+
verificationID: string;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
export * from './definitions';
|
|
9
|
+
export { MetaMapCapacitor };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const MetaMapCapacitorUnwrapped = registerPlugin('MetaMapCapacitor', {});
|
|
3
|
+
const MetaMapCapacitor = {
|
|
4
|
+
showMetaMapFlow: function (options) {
|
|
5
|
+
const { metadata } = options;
|
|
6
|
+
return MetaMapCapacitorUnwrapped.showMetaMapFlow(Object.assign(Object.assign({}, options), { metadata: Object.assign(Object.assign({}, metadata), { sdkType: "capacitor" }) }));
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
export { MetaMapCapacitor };
|
|
10
|
+
//# 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;AAMjD,MAAM,yBAAyB,GAAG,cAAc,CAAyB,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAEjG,MAAM,gBAAgB,GAAG;IACrB,eAAe,EAAE,UAAS,OAAsB;QAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QAC5B,OAAO,yBAAyB,CAAC,eAAe,iCAAK,OAAO,KAAE,QAAQ,kCAAM,QAAQ,KAAE,OAAO,EAAE,WAAW,OAAI,CAAA;IAClH,CAAC;CACJ,CAAA;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var MatiCapacitorPlugin = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const MetaMapCapacitorUnwrapped = core.registerPlugin('MetaMapCapacitor', {});
|
|
5
|
+
const MetaMapCapacitor = {
|
|
6
|
+
showMetaMapFlow: function (options) {
|
|
7
|
+
const { metadata } = options;
|
|
8
|
+
return MetaMapCapacitorUnwrapped.showMetaMapFlow(Object.assign(Object.assign({}, options), { metadata: Object.assign(Object.assign({}, metadata), { sdkType: "capacitor" }) }));
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.MetaMapCapacitor = MetaMapCapacitor;
|
|
13
|
+
|
|
14
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
15
|
+
|
|
16
|
+
return exports;
|
|
17
|
+
|
|
18
|
+
})({}, capacitorExports);
|
|
19
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst MetaMapCapacitorUnwrapped = registerPlugin('MetaMapCapacitor', {});\nconst MetaMapCapacitor = {\n showMetaMapFlow: function (options) {\n const { metadata } = options;\n return MetaMapCapacitorUnwrapped.showMetaMapFlow(Object.assign(Object.assign({}, options), { metadata: Object.assign(Object.assign({}, metadata), { sdkType: \"capacitor\" }) }));\n },\n};\nexport { MetaMapCapacitor };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;IACA,MAAM,yBAAyB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AACpE,UAAC,gBAAgB,GAAG;IACzB,IAAI,eAAe,EAAE,UAAU,OAAO,EAAE;IACxC,QAAQ,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACrC,QAAQ,OAAO,yBAAyB,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACxL,KAAK;IACL;;;;;;;;;;;;"}
|
|
@@ -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>1.0</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
|
+
|