Skip to content

Commit 891bc08

Browse files
author
Alexandr Makarov
committed
feat: fix for paywalls did load callback
1 parent 83a33bc commit 891bc08

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

android/src/main/java/com/reactnativeapphudsdk/ApphudSdkModule.kt

+10
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ class ApphudSdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJ
189189
);
190190
}
191191

192+
@ReactMethod
193+
fun paywallsDidLoadCallback(promise: Promise) {
194+
val paywalls = Apphud.paywalls();
195+
val result: WritableNativeArray = WritableNativeArray();
196+
for (paywall in paywalls) {
197+
result.pushMap(ApphudDataTransformer.getApphudPaywallMap(paywall));
198+
}
199+
promise.resolve(result);
200+
}
201+
192202
@ReactMethod
193203
fun setUserProperty(key: String, value: String, setOnce: Boolean, promise: Promise) {
194204
val label = getUserPropertyKey(key);

example/android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
13+
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
1414

1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit

0 commit comments

Comments
 (0)