change(react-native): android use promise
This commit is contained in:
parent
f95c1c9c94
commit
076e664ced
1 changed files with 7 additions and 2 deletions
|
|
@ -95,8 +95,13 @@ class ReactNativeModule(reactContext: ReactApplicationContext) :
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
fun getSessionId(): String {
|
fun getSessionID(promise: Promise) {
|
||||||
return OpenReplay.getSessionId()
|
try {
|
||||||
|
val sessionId = OpenReplay.getSessionID() ?: ""
|
||||||
|
promise.resolve(sessionId) // Resolve the promise with the session ID
|
||||||
|
} catch (e: Exception) {
|
||||||
|
promise.reject("GET_SESSION_ID_ERROR", "Failed to retrieve session ID", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue