Commit 8064e355 authored by hewenhao's avatar hewenhao

feat(util): 添加原生桥接调试日志

在use-native-bridge工具函数中添加调试日志,便于追踪原生方法调用和回调处理流程, 方便问题排查和调试。
parent 7dc5a36f
...@@ -103,6 +103,7 @@ function invokeNativeMethod<T = any, P = any> (arg: { type: string; data?: P }, ...@@ -103,6 +103,7 @@ function invokeNativeMethod<T = any, P = any> (arg: { type: string; data?: P },
eventBus.on(GEEK_NATIVE_NAME, onCallback) eventBus.on(GEEK_NATIVE_NAME, onCallback)
function onCallback (params?: NativeInvokeFuncParams) { function onCallback (params?: NativeInvokeFuncParams) {
console.log('onCallback', params)
if (params?.method === callbackName) { if (params?.method === callbackName) {
if (timer) { if (timer) {
clearTimeout(timer) clearTimeout(timer)
...@@ -116,6 +117,8 @@ function invokeNativeMethod<T = any, P = any> (arg: { type: string; data?: P }, ...@@ -116,6 +117,8 @@ function invokeNativeMethod<T = any, P = any> (arg: { type: string; data?: P },
} }
} }
console.log('sendNativeMessage', { ...arg, __callback__: callbackName })
sendNativeMessage({ ...arg, __callback__: callbackName }) sendNativeMessage({ ...arg, __callback__: callbackName })
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment