@@ -2,6 +2,7 @@ package net.mjstudio.rnkakao.user
22
33import com.facebook.react.bridge.Promise
44import com.facebook.react.bridge.ReactApplicationContext
5+ import com.facebook.react.bridge.ReactMethod
56import com.facebook.react.bridge.ReadableArray
67import com.kakao.sdk.auth.AuthApiClient
78import com.kakao.sdk.auth.model.OAuthToken
@@ -27,6 +28,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
2728 return NAME
2829 }
2930
31+ @ReactMethod
3032 override fun login (
3133 serviceTerms : ReadableArray ? ,
3234 prompts : ReadableArray ? ,
@@ -90,10 +92,12 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
9092 }
9193 }
9294
95+ @ReactMethod
9396 override fun isKakaoTalkLoginAvailable (promise : Promise ) {
9497 promise.resolve(UserApiClient .instance.isKakaoTalkLoginAvailable(reactApplicationContext))
9598 }
9699
100+ @ReactMethod
97101 override fun logout (promise : Promise ) {
98102 UserApiClient .instance.logout {
99103 if (it != null ) {
@@ -104,6 +108,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
104108 }
105109 }
106110
111+ @ReactMethod
107112 override fun unlink (promise : Promise ) {
108113 UserApiClient .instance.unlink {
109114 if (it != null ) {
@@ -114,6 +119,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
114119 }
115120 }
116121
122+ @ReactMethod
117123 override fun isLogined (promise : Promise ) {
118124 if (AuthApiClient .instance.hasToken()) {
119125 UserApiClient .instance.accessTokenInfo { _, error ->
@@ -132,6 +138,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
132138 }
133139 }
134140
141+ @ReactMethod
135142 override fun scopes (scopes : ReadableArray ? , promise : Promise ) {
136143 UserApiClient .instance.scopes { scopeInfo, error ->
137144 if (error != null ) {
@@ -156,6 +163,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
156163 }
157164 }
158165
166+ @ReactMethod
159167 override fun revokeScopes (scopes : ReadableArray , promise : Promise ) {
160168 UserApiClient .instance.revokeScopes(
161169 scopes = scopes.filterIsInstance<String >() ? : listOf ()
@@ -170,6 +178,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
170178 }
171179 }
172180
181+ @ReactMethod
173182 override fun serviceTerms (promise : Promise ) {
174183 UserApiClient .instance.serviceTerms { serviceTerms, error ->
175184 if (error != null ) {
@@ -191,6 +200,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
191200 }
192201 }
193202
203+ @ReactMethod
194204 override fun shippingAddresses (promise : Promise ) {
195205 UserApiClient .instance.shippingAddresses { addrs, error ->
196206 if (error != null ) {
@@ -224,6 +234,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
224234 }
225235 }
226236
237+ @ReactMethod
227238 override fun me (promise : Promise ) {
228239 UserApiClient .instance.me { user, error ->
229240 if (error != null ) {
0 commit comments