Skip to content

Commit 9580e5f

Browse files
committed
Android corrections for old arch
1 parent 1b60d72 commit 9580e5f

File tree

3 files changed

+18
-30
lines changed

3 files changed

+18
-30
lines changed

android/src/main/java/com/drpogodin/reactnativestaticserver/ReactNativeStaticServerModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class ReactNativeStaticServerModule internal constructor(context: ReactApplicati
113113
}
114114

115115
@ReactMethod
116-
override fun getOpenPort(address: String?, promise: Promise) {
116+
override fun getOpenPort(address: String, promise: Promise) {
117117
try {
118118
val socket = ServerSocket(
119119
0, 0, InetAddress.getByName(address))

android/src/oldarch/ReactNativeStaticServerSpec.java

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
package com.drpogodin.reactnativestaticserver
22

3+
import com.facebook.react.bridge.Promise
34
import com.facebook.react.bridge.ReactApplicationContext
45
import com.facebook.react.bridge.ReactContextBaseJavaModule
5-
import com.facebook.react.bridge.Promise
66

77
abstract class ReactNativeStaticServerSpec internal constructor(context: ReactApplicationContext) :
88
ReactContextBaseJavaModule(context) {
9+
abstract override fun getName(): String
10+
abstract fun getTypedExportedConstants(): Map<String, Any>
11+
12+
override fun getConstants(): Map<String, Any>? {
13+
return getTypedExportedConstants()
14+
}
15+
16+
abstract fun start(
17+
id: Double, configPath: String?, errlogPath: String?, promise: Promise?)
18+
19+
abstract fun getLocalIpAddress(promise: Promise)
20+
abstract fun getOpenPort(address: String, promise: Promise)
21+
abstract fun stop(promise: Promise?)
22+
23+
abstract fun addListener(eventName: String?)
924

10-
abstract fun multiply(a: Double, b: Double, promise: Promise)
25+
abstract fun removeListeners(count: Double)
1126
}

0 commit comments

Comments
 (0)