wendux / DSBridge-Android

:earth_americas: A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.
3.78k stars 618 forks source link

Is it possible pass Native class object to js ? #61

Closed mksantoki closed 6 years ago

mksantoki commented 6 years ago

I added description here below link

https://stackoverflow.com/questions/51481575/web-apps-in-webview-android

buhe commented 6 years ago

You can convert object to json

mksantoki commented 6 years ago

Thank you for your response. Can you please help how to convert netive class object to json native class example like database class.

On Sun 12 Aug, 2018, 10:39 AM buhe, notifications@github.com wrote:

You can convert object to json

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wendux/DSBridge-Android/issues/61#issuecomment-412319190, or mute the thread https://github.com/notifications/unsubscribe-auth/AK9qbTEUWi6vez6ptrRBVnA6-JPBkSV6ks5uP7htgaJpZM4VfglM .

buhe commented 6 years ago

You can use gson to convert java to json on Native App and use JSON.parse from json to JS Object on Webview.

wendux commented 6 years ago

@mksantoki As @buhe says, you should convert Java object to json to pass。