@@ -36,8 +36,8 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
3636 " setEnv" -> setEnv(argsNullable(0 ))
3737 " getLocale" -> getLocale(callback)
3838 " setLocale" -> setLocale(argsNullable(0 ))
39- " setLocalizationDictionary" -> setLocalizationDictionary(args (0 ))
40- " setRequestHeaders" -> setRequestHeaders(args (0 ))
39+ " setLocalizationDictionary" -> setLocalizationDictionary(argsNullable (0 ))
40+ " setRequestHeaders" -> setRequestHeaders(argsNullable (0 ))
4141 " setCustomization" -> setCustomization(args(0 ))
4242 " isInitialized" -> isInitialized(callback)
4343 " initialize" -> initialize(callback, argsNullable(0 ))
@@ -99,13 +99,13 @@ fun getLocale(callback: Callback) = callback(Instance().locale)
9999
100100fun setLocale (locale : String? ) = locale.let { Instance ().locale = it }
101101
102- fun setLocalizationDictionary (dictionary : JSONObject ) {
103- localizationCallbacks = LocalizationCallbacks { if (dictionary.has(it)) dictionary.getString(it) else null }
102+ fun setLocalizationDictionary (dictionary : JSONObject ? ) {
103+ localizationCallbacks = LocalizationCallbacks { if (dictionary? .has(it) == true ) dictionary.getString(it) else null }
104104 Instance ().setLocalizationCallback(localizationCallbacks!! )
105105}
106106
107- fun setRequestHeaders (headers : JSONObject ) {
108- networkInterceptorListener = NetworkInterceptorListener { headers.forEach { k, v -> it.header(k, v as String ) } }
107+ fun setRequestHeaders (headers : JSONObject ? ) {
108+ networkInterceptorListener = NetworkInterceptorListener { headers? .forEach { k, v -> it.header(k, v as String ) } }
109109 Instance ().setNetworkInterceptorListener(networkInterceptorListener)
110110}
111111
@@ -128,13 +128,13 @@ fun deinitialize() = Instance().deinitialize()
128128
129129fun startFaceCapture (callback : Callback , config : JSONObject ? ) = config?.let {
130130 Instance ().presentFaceCaptureActivity(
131- context ,
131+ activity ,
132132 faceCaptureConfigFromJSON(it),
133133 faceCaptureCompletion(callback),
134134 faceCaptureNotificationCompletion()
135135 )
136136} ? : Instance ().presentFaceCaptureActivity(
137- context ,
137+ activity ,
138138 faceCaptureCompletion(callback),
139139 faceCaptureNotificationCompletion()
140140)
@@ -143,13 +143,13 @@ fun stopFaceCapture() = Instance().stopFaceCaptureActivity(context)
143143
144144fun startLiveness (callback : Callback , config : JSONObject ? ) = config?.let {
145145 Instance ().startLiveness(
146- context ,
146+ activity ,
147147 livenessConfigFromJSON(it),
148148 livenessCompletion(callback),
149149 livenessNotificationCompletion()
150150 )
151151} ? : Instance ().startLiveness(
152- context ,
152+ activity ,
153153 livenessCompletion(callback),
154154 livenessNotificationCompletion()
155155)
0 commit comments