Skip to content

Commit 02fb2d1

Browse files
authored
fix: fix android init error (#225)
아래는 참고 사항입니다. ``` @ReactMethod fun initialize( consumerKey: String, consumerSecret: String, appName: String, ): Unit { // 명시적 Unit 반환 // 현재 함수형으로 변경해서 추론가능하게 변경 UiThreadUtil.runOnUiThread { NaverIdLoginSDK.initialize(...) } } ``` @ReactMethod fun initialize( consumerKey: String, consumerSecret: String, appName: String, promise: Promise ) { UiThreadUtil.runOnUiThread { try { NaverIdLoginSDK.initialize(...) promise.resolve(true) } catch (e: Exception) { promise.reject("ERROR", e.message) } } } ``` ```
1 parent ea159f3 commit 02fb2d1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

android/src/main/java/com/dooboolab/naverlogin/RNNaverLoginModule.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ class RNNaverLoginModule(reactContext: ReactApplicationContext) : ReactContextBa
3737
consumerKey: String,
3838
consumerSecret: String,
3939
appName: String,
40-
) = UiThreadUtil.runOnUiThread {
41-
NaverIdLoginSDK.initialize(
42-
reactApplicationContext,
43-
clientId = consumerKey,
44-
clientSecret = consumerSecret,
45-
clientName = appName,
46-
)
40+
) {
41+
UiThreadUtil.runOnUiThread {
42+
NaverIdLoginSDK.initialize(
43+
reactApplicationContext,
44+
clientId = consumerKey,
45+
clientSecret = consumerSecret,
46+
clientName = appName,
47+
)
48+
}
4749
}
4850

4951
@ReactMethod

0 commit comments

Comments
 (0)