banking_dcb_sdk_react_native 1.0.3 → 1.0.5
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.
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
package com.partnerreactnativesdk
|
|
2
2
|
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
3
4
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
4
|
-
import com.facebook.react.
|
|
5
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
6
|
+
import com.facebook.react.bridge.ReactMethod
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
class PartnerReactNativeSdkModule(
|
|
9
|
+
private val reactContext: ReactApplicationContext
|
|
10
|
+
) : ReactContextBaseJavaModule(reactContext) {
|
|
9
11
|
|
|
10
|
-
override fun getName(): String
|
|
11
|
-
return NAME
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Example method
|
|
15
|
-
// See https://reactnative.dev/docs/native-modules-android
|
|
16
|
-
override fun multiply(a: Double, b: Double): Double {
|
|
17
|
-
return a * b
|
|
18
|
-
}
|
|
12
|
+
override fun getName(): String = "PartnerReactNativeSdk"
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
@ReactMethod
|
|
15
|
+
fun multiply(a: Double, b: Double, promise: Promise) {
|
|
16
|
+
promise.resolve(a * b)
|
|
22
17
|
}
|
|
23
18
|
}
|
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
package com.partnerreactnativesdk
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
3
|
+
import com.facebook.react.ReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.
|
|
7
|
-
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
-
import java.util.HashMap
|
|
6
|
+
import com.facebook.react.uimanager.ViewManager
|
|
9
7
|
|
|
10
|
-
class PartnerReactNativeSdkPackage :
|
|
11
|
-
override fun
|
|
12
|
-
return
|
|
13
|
-
PartnerReactNativeSdkModule(reactContext)
|
|
14
|
-
} else {
|
|
15
|
-
null
|
|
16
|
-
}
|
|
8
|
+
class PartnerReactNativeSdkPackage : ReactPackage {
|
|
9
|
+
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
10
|
+
return listOf(PartnerReactNativeSdkModule(reactContext))
|
|
17
11
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return ReactModuleInfoProvider {
|
|
21
|
-
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
22
|
-
moduleInfos[PartnerReactNativeSdkModule.NAME] = ReactModuleInfo(
|
|
23
|
-
PartnerReactNativeSdkModule.NAME,
|
|
24
|
-
PartnerReactNativeSdkModule.NAME,
|
|
25
|
-
false, // canOverrideExistingModule
|
|
26
|
-
false, // needsEagerInit
|
|
27
|
-
false, // isCxxModule
|
|
28
|
-
true // isTurboModule
|
|
29
|
-
)
|
|
30
|
-
moduleInfos
|
|
31
|
-
}
|
|
12
|
+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
13
|
+
return emptyList()
|
|
32
14
|
}
|
|
33
15
|
}
|