react-native-klarna-inapp-sdk 2.1.12 → 2.2.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/README.md +100 -270
- package/android/build.gradle +85 -107
- package/android/gradle.properties +7 -0
- package/android/src/main/AndroidManifest.xml +2 -1
- package/android/src/main/AndroidManifestNew.xml +4 -0
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/KlarnaMobileSDKPackage.java +33 -0
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/common/ArgumentsUtil.java +62 -0
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/common/WebViewResizeObserver.java +100 -0
- package/android/src/main/java/com/klarna/{inapp/sdk → mobile/sdk/reactnative/payments}/KlarnaPaymentEvent.java +9 -19
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/payments/KlarnaPaymentViewManager.java +346 -0
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/payments/PaymentViewWrapper.java +78 -0
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/standalonewebview/KlarnaStandaloneWebViewEvent.java +67 -0
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/standalonewebview/KlarnaStandaloneWebViewEventSender.java +139 -0
- package/android/src/main/java/com/klarna/mobile/sdk/reactnative/standalonewebview/KlarnaStandaloneWebViewManager.java +205 -0
- package/android/src/newarch/java/com/klarna/mobile/sdk/reactnative/spec/RNKlarnaPaymentViewSpec.java +32 -0
- package/android/src/newarch/java/com/klarna/mobile/sdk/reactnative/spec/RNKlarnaStandaloneWebViewSpec.java +33 -0
- package/android/src/oldarch/java/com/klarna/mobile/sdk/reactnative/spec/RNKlarnaPaymentViewSpec.java +25 -0
- package/android/src/oldarch/java/com/klarna/mobile/sdk/reactnative/spec/RNKlarnaStandaloneWebViewSpec.java +19 -0
- package/android/src/test/java/com/klarna/{inapp/sdk/KlarnaPaymentViewPackageTest.java → mobile/sdk/reactnative/KlarnaMobileSDKPackageTest.java} +9 -4
- package/android/src/test/java/com/klarna/{inapp/sdk → mobile/sdk/reactnative/payments}/KlarnaPaymentEventTest.java +17 -20
- package/android/src/test/java/com/klarna/{inapp/sdk → mobile/sdk/reactnative/payments}/KlarnaPaymentViewManagerTest.java +72 -29
- package/ios/{KlarnaInAppSDK.xcodeproj → RNKlarnaMobileSDK.xcodeproj}/project.pbxproj +147 -87
- package/ios/{KlarnaInAppSDK.xcodeproj/xcshareddata/xcschemes/KlarnaInAppSDK.xcscheme → RNKlarnaMobileSDK.xcodeproj/xcshareddata/xcschemes/RNKlarnaMobileSDK.xcscheme} +9 -9
- package/ios/{KlarnaInAppSDK.xcodeproj/xcshareddata/xcschemes/KlarnaInAppSDKTests.xcscheme → RNKlarnaMobileSDK.xcodeproj/xcshareddata/xcschemes/RNKlarnaMobileSDKTests.xcscheme} +3 -3
- package/ios/Sources/KlarnaPaymentViewManager.h +5 -0
- package/ios/Sources/{KlarnaPaymentView.m → KlarnaPaymentViewManager.mm} +10 -15
- package/ios/Sources/KlarnaStandaloneWebViewManager.h +5 -0
- package/ios/Sources/KlarnaStandaloneWebViewManager.mm +77 -0
- package/ios/Sources/view/newarch/KlarnaStandaloneWebViewWrapper.h +29 -0
- package/ios/Sources/view/newarch/KlarnaStandaloneWebViewWrapper.mm +265 -0
- package/ios/Sources/view/newarch/PaymentViewWrapper.h +33 -0
- package/ios/Sources/view/newarch/PaymentViewWrapper.mm +240 -0
- package/ios/Sources/view/oldarch/KlarnaStandaloneWebViewWrapper.h +42 -0
- package/ios/Sources/view/oldarch/KlarnaStandaloneWebViewWrapper.mm +195 -0
- package/ios/Sources/view/{PaymentViewWrapper.h → oldarch/PaymentViewWrapper.h} +9 -7
- package/ios/Sources/view/{PaymentViewWrapper.m → oldarch/PaymentViewWrapper.mm} +40 -27
- package/ios/Tests/PaymentViewWrapperTests.m +8 -10
- package/lib/commonjs/KlarnaPaymentView.js +192 -0
- package/lib/commonjs/KlarnaPaymentView.js.map +1 -0
- package/lib/commonjs/KlarnaStandaloneWebView.js +81 -0
- package/lib/commonjs/KlarnaStandaloneWebView.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/specs/KlarnaPaymentViewNativeComponent.js +16 -0
- package/lib/commonjs/specs/KlarnaPaymentViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/KlarnaStandaloneWebViewNativeComponent.js +16 -0
- package/lib/commonjs/specs/KlarnaStandaloneWebViewNativeComponent.js.map +1 -0
- package/lib/module/KlarnaPaymentView.js +182 -0
- package/lib/module/KlarnaPaymentView.js.map +1 -0
- package/lib/module/KlarnaStandaloneWebView.js +71 -0
- package/lib/module/KlarnaStandaloneWebView.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/KlarnaPaymentViewNativeComponent.js +7 -0
- package/lib/module/specs/KlarnaPaymentViewNativeComponent.js.map +1 -0
- package/lib/module/specs/KlarnaStandaloneWebViewNativeComponent.js +7 -0
- package/lib/module/specs/KlarnaStandaloneWebViewNativeComponent.js.map +1 -0
- package/lib/typescript/KlarnaPaymentView.d.ts +51 -0
- package/lib/typescript/KlarnaPaymentView.d.ts.map +1 -0
- package/lib/typescript/KlarnaStandaloneWebView.d.ts +46 -0
- package/lib/typescript/KlarnaStandaloneWebView.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/specs/KlarnaPaymentViewNativeComponent.d.ts +49 -0
- package/lib/typescript/specs/KlarnaPaymentViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/specs/KlarnaStandaloneWebViewNativeComponent.d.ts +65 -0
- package/lib/typescript/specs/KlarnaStandaloneWebViewNativeComponent.d.ts.map +1 -0
- package/package.json +92 -16
- package/react-native-klarna-inapp-sdk.podspec +32 -13
- package/src/KlarnaPaymentView.tsx +323 -0
- package/src/KlarnaStandaloneWebView.tsx +217 -0
- package/src/index.tsx +2 -0
- package/src/specs/KlarnaPaymentViewNativeComponent.ts +99 -0
- package/src/specs/KlarnaStandaloneWebViewNativeComponent.ts +96 -0
- package/.gitattributes +0 -3
- package/CHANGELOG.md +0 -111
- package/android/README.md +0 -14
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradlew +0 -172
- package/android/gradlew.bat +0 -84
- package/android/src/main/java/com/klarna/inapp/sdk/HeightListener.java +0 -159
- package/android/src/main/java/com/klarna/inapp/sdk/KlarnaPaymentViewManager.java +0 -282
- package/android/src/main/java/com/klarna/inapp/sdk/KlarnaPaymentViewPackage.java +0 -25
- package/android/src/main/java/com/klarna/inapp/sdk/Mappable.java +0 -10
- package/android/src/main/java/com/klarna/inapp/sdk/MappableKlarnaPaymentsSDKError.java +0 -31
- package/android/src/main/java/com/klarna/inapp/sdk/PaymentViewWrapper.java +0 -131
- package/android/src/test/java/com/klarna/inapp/sdk/MappableKlarnaPaymentsSDKErrorTest.java +0 -45
- package/index.js +0 -72
- package/integration-tests/build.gradle +0 -59
- package/integration-tests/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/integration-tests/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/integration-tests/gradlew +0 -172
- package/integration-tests/gradlew.bat +0 -84
- package/integration-tests/settings.gradle +0 -2
- package/integration-tests/src/test/resources/junit-platform.properties +0 -4
- package/ios/KlarnaInAppSDK.xcworkspace/contents.xcworkspacedata +0 -10
- package/ios/KlarnaInAppSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Podfile +0 -73
- package/ios/Sources/KlarnaPaymentView.h +0 -5
- package/scripts/examples_postinstall.js +0 -111
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
##############################################################################
|
|
4
|
-
##
|
|
5
|
-
## Gradle start up script for UN*X
|
|
6
|
-
##
|
|
7
|
-
##############################################################################
|
|
8
|
-
|
|
9
|
-
# Attempt to set APP_HOME
|
|
10
|
-
# Resolve links: $0 may be a link
|
|
11
|
-
PRG="$0"
|
|
12
|
-
# Need this for relative symlinks.
|
|
13
|
-
while [ -h "$PRG" ] ; do
|
|
14
|
-
ls=`ls -ld "$PRG"`
|
|
15
|
-
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
16
|
-
if expr "$link" : '/.*' > /dev/null; then
|
|
17
|
-
PRG="$link"
|
|
18
|
-
else
|
|
19
|
-
PRG=`dirname "$PRG"`"/$link"
|
|
20
|
-
fi
|
|
21
|
-
done
|
|
22
|
-
SAVED="`pwd`"
|
|
23
|
-
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
24
|
-
APP_HOME="`pwd -P`"
|
|
25
|
-
cd "$SAVED" >/dev/null
|
|
26
|
-
|
|
27
|
-
APP_NAME="Gradle"
|
|
28
|
-
APP_BASE_NAME=`basename "$0"`
|
|
29
|
-
|
|
30
|
-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
31
|
-
DEFAULT_JVM_OPTS=""
|
|
32
|
-
|
|
33
|
-
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
34
|
-
MAX_FD="maximum"
|
|
35
|
-
|
|
36
|
-
warn () {
|
|
37
|
-
echo "$*"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
die () {
|
|
41
|
-
echo
|
|
42
|
-
echo "$*"
|
|
43
|
-
echo
|
|
44
|
-
exit 1
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
# OS specific support (must be 'true' or 'false').
|
|
48
|
-
cygwin=false
|
|
49
|
-
msys=false
|
|
50
|
-
darwin=false
|
|
51
|
-
nonstop=false
|
|
52
|
-
case "`uname`" in
|
|
53
|
-
CYGWIN* )
|
|
54
|
-
cygwin=true
|
|
55
|
-
;;
|
|
56
|
-
Darwin* )
|
|
57
|
-
darwin=true
|
|
58
|
-
;;
|
|
59
|
-
MINGW* )
|
|
60
|
-
msys=true
|
|
61
|
-
;;
|
|
62
|
-
NONSTOP* )
|
|
63
|
-
nonstop=true
|
|
64
|
-
;;
|
|
65
|
-
esac
|
|
66
|
-
|
|
67
|
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
68
|
-
|
|
69
|
-
# Determine the Java command to use to start the JVM.
|
|
70
|
-
if [ -n "$JAVA_HOME" ] ; then
|
|
71
|
-
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
72
|
-
# IBM's JDK on AIX uses strange locations for the executables
|
|
73
|
-
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
74
|
-
else
|
|
75
|
-
JAVACMD="$JAVA_HOME/bin/java"
|
|
76
|
-
fi
|
|
77
|
-
if [ ! -x "$JAVACMD" ] ; then
|
|
78
|
-
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
79
|
-
|
|
80
|
-
Please set the JAVA_HOME variable in your environment to match the
|
|
81
|
-
location of your Java installation."
|
|
82
|
-
fi
|
|
83
|
-
else
|
|
84
|
-
JAVACMD="java"
|
|
85
|
-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
86
|
-
|
|
87
|
-
Please set the JAVA_HOME variable in your environment to match the
|
|
88
|
-
location of your Java installation."
|
|
89
|
-
fi
|
|
90
|
-
|
|
91
|
-
# Increase the maximum file descriptors if we can.
|
|
92
|
-
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
93
|
-
MAX_FD_LIMIT=`ulimit -H -n`
|
|
94
|
-
if [ $? -eq 0 ] ; then
|
|
95
|
-
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
96
|
-
MAX_FD="$MAX_FD_LIMIT"
|
|
97
|
-
fi
|
|
98
|
-
ulimit -n $MAX_FD
|
|
99
|
-
if [ $? -ne 0 ] ; then
|
|
100
|
-
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
101
|
-
fi
|
|
102
|
-
else
|
|
103
|
-
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
104
|
-
fi
|
|
105
|
-
fi
|
|
106
|
-
|
|
107
|
-
# For Darwin, add options to specify how the application appears in the dock
|
|
108
|
-
if $darwin; then
|
|
109
|
-
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
# For Cygwin, switch paths to Windows format before running java
|
|
113
|
-
if $cygwin ; then
|
|
114
|
-
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
115
|
-
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
116
|
-
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
117
|
-
|
|
118
|
-
# We build the pattern for arguments to be converted via cygpath
|
|
119
|
-
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
120
|
-
SEP=""
|
|
121
|
-
for dir in $ROOTDIRSRAW ; do
|
|
122
|
-
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
123
|
-
SEP="|"
|
|
124
|
-
done
|
|
125
|
-
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
126
|
-
# Add a user-defined pattern to the cygpath arguments
|
|
127
|
-
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
128
|
-
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
129
|
-
fi
|
|
130
|
-
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
131
|
-
i=0
|
|
132
|
-
for arg in "$@" ; do
|
|
133
|
-
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
134
|
-
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
135
|
-
|
|
136
|
-
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
137
|
-
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
138
|
-
else
|
|
139
|
-
eval `echo args$i`="\"$arg\""
|
|
140
|
-
fi
|
|
141
|
-
i=$((i+1))
|
|
142
|
-
done
|
|
143
|
-
case $i in
|
|
144
|
-
(0) set -- ;;
|
|
145
|
-
(1) set -- "$args0" ;;
|
|
146
|
-
(2) set -- "$args0" "$args1" ;;
|
|
147
|
-
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
148
|
-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
149
|
-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
150
|
-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
151
|
-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
152
|
-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
153
|
-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
154
|
-
esac
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
# Escape application args
|
|
158
|
-
save () {
|
|
159
|
-
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
160
|
-
echo " "
|
|
161
|
-
}
|
|
162
|
-
APP_ARGS=$(save "$@")
|
|
163
|
-
|
|
164
|
-
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
165
|
-
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
166
|
-
|
|
167
|
-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
168
|
-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
169
|
-
cd "$(dirname "$0")"
|
|
170
|
-
fi
|
|
171
|
-
|
|
172
|
-
exec "$JAVACMD" "$@"
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
set DIRNAME=%~dp0
|
|
12
|
-
if "%DIRNAME%" == "" set DIRNAME=.
|
|
13
|
-
set APP_BASE_NAME=%~n0
|
|
14
|
-
set APP_HOME=%DIRNAME%
|
|
15
|
-
|
|
16
|
-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
17
|
-
set DEFAULT_JVM_OPTS=
|
|
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 Windows variants
|
|
50
|
-
|
|
51
|
-
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
52
|
-
|
|
53
|
-
:win9xME_args
|
|
54
|
-
@rem Slurp the command line arguments.
|
|
55
|
-
set CMD_LINE_ARGS=
|
|
56
|
-
set _SKIP=2
|
|
57
|
-
|
|
58
|
-
:win9xME_args_slurp
|
|
59
|
-
if "x%~1" == "x" goto execute
|
|
60
|
-
|
|
61
|
-
set CMD_LINE_ARGS=%*
|
|
62
|
-
|
|
63
|
-
:execute
|
|
64
|
-
@rem Setup the command line
|
|
65
|
-
|
|
66
|
-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
67
|
-
|
|
68
|
-
@rem Execute Gradle
|
|
69
|
-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
70
|
-
|
|
71
|
-
:end
|
|
72
|
-
@rem End local scope for the variables with windows NT shell
|
|
73
|
-
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
74
|
-
|
|
75
|
-
:fail
|
|
76
|
-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
77
|
-
rem the _cmd.exe /c_ return code!
|
|
78
|
-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
79
|
-
exit /b 1
|
|
80
|
-
|
|
81
|
-
:mainEnd
|
|
82
|
-
if "%OS%"=="Windows_NT" endlocal
|
|
83
|
-
|
|
84
|
-
:omega
|
package/ios/Podfile
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Uncomment the next line to define a global platform for your project
|
|
2
|
-
# platform :ios, '9.0'
|
|
3
|
-
|
|
4
|
-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
|
5
|
-
|
|
6
|
-
target 'KlarnaInAppSDK' do
|
|
7
|
-
# Comment the next line if you don't want to use dynamic frameworks
|
|
8
|
-
# use_frameworks!
|
|
9
|
-
|
|
10
|
-
# Pods for KlarnaInAppSDK
|
|
11
|
-
pod 'KlarnaMobileSDK', '2.6.4'
|
|
12
|
-
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
|
|
13
|
-
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"
|
|
14
|
-
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
|
|
15
|
-
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
|
|
16
|
-
pod 'React', :path => '../node_modules/react-native/'
|
|
17
|
-
pod 'React-Core', :path => '../node_modules/react-native/'
|
|
18
|
-
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
|
|
19
|
-
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
|
|
20
|
-
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
|
|
21
|
-
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
|
|
22
|
-
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
|
|
23
|
-
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
|
|
24
|
-
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
|
|
25
|
-
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
|
|
26
|
-
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
|
|
27
|
-
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
|
|
28
|
-
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
|
|
29
|
-
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
|
|
30
|
-
|
|
31
|
-
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
|
|
32
|
-
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
|
|
33
|
-
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
|
|
34
|
-
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
|
|
35
|
-
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
|
|
36
|
-
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
|
|
37
|
-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
|
|
38
|
-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
|
|
39
|
-
pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
|
|
40
|
-
|
|
41
|
-
pod 'React-callinvoker', :path => '../node_modules/react-native/ReactCommon/callinvoker'
|
|
42
|
-
pod 'React-perflogger', :path => '../node_modules/react-native/ReactCommon/reactperflogger'
|
|
43
|
-
pod 'React-runtimeexecutor', :path => '../node_modules/react-native/ReactCommon/runtimeexecutor'
|
|
44
|
-
|
|
45
|
-
target 'KlarnaInAppSDKTests' do
|
|
46
|
-
# Pods for testing
|
|
47
|
-
pod 'OCMock'
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
use_native_modules!
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
post_install do |installer|
|
|
55
|
-
## Fix for XCode 13
|
|
56
|
-
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
|
|
57
|
-
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
|
|
58
|
-
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
|
|
59
|
-
"RCTBridgeModuleNameForClass(strongModule))", "RCTBridgeModuleNameForClass(Class(strongModule)))")
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def find_and_replace(dir, findstr, replacestr)
|
|
63
|
-
Dir[dir].each do |name|
|
|
64
|
-
text = File.read(name)
|
|
65
|
-
replace = text.gsub(findstr,replacestr)
|
|
66
|
-
if text != replace
|
|
67
|
-
puts "Fix: " + name
|
|
68
|
-
File.open(name, "w") { |file| file.puts replace }
|
|
69
|
-
STDOUT.flush
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
Dir[dir + '*/'].each(&method(:find_and_replace))
|
|
73
|
-
end
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Using libraries within examples and linking them within packages.json like:
|
|
5
|
-
* "react-native-library-name": "file:../"
|
|
6
|
-
* will cause problems with the metro bundler if the example will run via
|
|
7
|
-
* `react-native run-[ios|android]`. This will result in an error as the metro
|
|
8
|
-
* bundler will find multiple versions for the same module while resolving it.
|
|
9
|
-
* The reason for that is that if the library is installed it also copies in the
|
|
10
|
-
* example folder itself as well as the node_modules folder of the library
|
|
11
|
-
* although their are defined in .npmignore and should be ignored in theory.
|
|
12
|
-
*
|
|
13
|
-
* This postinstall script removes the node_modules folder as well as all
|
|
14
|
-
* entries from the libraries .npmignore file within the examples node_modules
|
|
15
|
-
* folder after the library was installed. This should resolve the metro
|
|
16
|
-
* bundler issue mentioned above.
|
|
17
|
-
*
|
|
18
|
-
* It is expected this scripts lives in the libraries root folder within a
|
|
19
|
-
* scripts folder. As first parameter the relative path to the libraries
|
|
20
|
-
* folder within the example's node_modules folder may be provided.
|
|
21
|
-
* This script will determine the path from this project's package.json file
|
|
22
|
-
* if no such relative path is provided.
|
|
23
|
-
* An example's package.json entry could look like:
|
|
24
|
-
* "postinstall": "node ../scripts/examples_postinstall.js node_modules/react-native-library-name/"
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
'use strict';
|
|
28
|
-
|
|
29
|
-
const fs = require('fs');
|
|
30
|
-
const path = require('path');
|
|
31
|
-
|
|
32
|
-
/// Delete all files and directories for the given path
|
|
33
|
-
const removeFileDirectoryRecursively = fileDirPath => {
|
|
34
|
-
// Remove file
|
|
35
|
-
if (!fs.lstatSync(fileDirPath).isDirectory()) {
|
|
36
|
-
fs.unlinkSync(fileDirPath);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Go down the directory an remove each file / directory recursively
|
|
41
|
-
fs.readdirSync(fileDirPath).forEach(entry => {
|
|
42
|
-
const entryPath = path.join(fileDirPath, entry);
|
|
43
|
-
removeFileDirectoryRecursively(entryPath);
|
|
44
|
-
});
|
|
45
|
-
fs.rmdirSync(fileDirPath);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/// Remove TestApp/node_modules/react-native-library-name/node_modules directory
|
|
49
|
-
const removeLibraryNodeModulesPath = (libraryNodeModulesPath) => {
|
|
50
|
-
const nodeModulesPath = path.resolve(libraryNodeModulesPath, 'node_modules')
|
|
51
|
-
|
|
52
|
-
if (!fs.existsSync(nodeModulesPath)) {
|
|
53
|
-
console.log(`No node_modules path found at ${nodeModulesPath}. Skipping delete.`)
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
console.log(`Deleting: ${nodeModulesPath}`)
|
|
58
|
-
try {
|
|
59
|
-
removeFileDirectoryRecursively(nodeModulesPath);
|
|
60
|
-
console.log(`Successfully deleted: ${nodeModulesPath}`)
|
|
61
|
-
} catch (err) {
|
|
62
|
-
console.log(`Error deleting ${nodeModulesPath}: ${err.message}`);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/// Remove all entries from the .npmignore within TestApp/node_modules/react-native-library-name/
|
|
67
|
-
const removeLibraryNpmIgnorePaths = (npmIgnorePath, libraryNodeModulesPath) => {
|
|
68
|
-
if (!fs.existsSync(npmIgnorePath)) {
|
|
69
|
-
console.log(`No .npmignore path found at ${npmIgnorePath}. Skipping deleting content.`);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
fs.readFileSync(npmIgnorePath, 'utf8').split(/\r?\n/).forEach(entry => {
|
|
74
|
-
if (entry.length === 0) {
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const npmIgnoreLibraryNodeModulesEntryPath = path.resolve(libraryNodeModulesPath, entry);
|
|
79
|
-
if (!fs.existsSync(npmIgnoreLibraryNodeModulesEntryPath)) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
console.log(`Deleting: ${npmIgnoreLibraryNodeModulesEntryPath}`)
|
|
84
|
-
try {
|
|
85
|
-
removeFileDirectoryRecursively(npmIgnoreLibraryNodeModulesEntryPath);
|
|
86
|
-
console.log(`Successfully deleted: ${npmIgnoreLibraryNodeModulesEntryPath}`)
|
|
87
|
-
} catch (err) {
|
|
88
|
-
console.log(`Error deleting ${npmIgnoreLibraryNodeModulesEntryPath}: ${err.message}`);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
// Main start sweeping process
|
|
94
|
-
(() => {
|
|
95
|
-
// Read out dir of example project
|
|
96
|
-
const exampleDir = process.cwd();
|
|
97
|
-
|
|
98
|
-
console.log(`Starting postinstall cleanup for ${exampleDir}`);
|
|
99
|
-
|
|
100
|
-
// Resolve the React Native library's path within the example's node_modules directory
|
|
101
|
-
const libraryNodeModulesPath = process.argv.length > 2
|
|
102
|
-
? path.resolve(exampleDir, process.argv[2])
|
|
103
|
-
: path.resolve(exampleDir, 'node_modules', require('../package.json').name);
|
|
104
|
-
|
|
105
|
-
console.log(`Removing unwanted artifacts for ${libraryNodeModulesPath}`);
|
|
106
|
-
|
|
107
|
-
removeLibraryNodeModulesPath(libraryNodeModulesPath);
|
|
108
|
-
|
|
109
|
-
const npmIgnorePath = path.resolve(__dirname, '../.npmignore');
|
|
110
|
-
removeLibraryNpmIgnorePaths(npmIgnorePath, libraryNodeModulesPath);
|
|
111
|
-
})();
|