how to calling native code from javascript ?native code(c++/object-c/java)

how to calling native code from javascript ?native code(c++/object-c/java)

i think use jsb calling camera,sensors etc….

what should i do ?

If you want to manually bind your native code to js.
This doc may help: https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_User_Guide#Native_functions

Also as a reference:


help me !

hammer is right.
Your question is too normal. Please refer to SpiderMonkey document.

James Chen wrote:

hammer is right.
Your question is too normal. Please refer to SpiderMonkey document.

i think use jab call android/ios camera,mic etc…

how do ? js > c++> java/oc ?

Yep, you have to expose Java classes or functions to c**, then expose c** classes to JS.
jqyp324 yp wrote:

James Chen wrote:
> hammer is right.
> Your question is too normal. Please refer to SpiderMonkey document.
>
i think use jab call android/ios camera,mic etc…
>
how do ? js > c++> java/oc ?

James Chen wrote:

Yep, you have to expose Java classes or functions to c**, then expose c** classes to JS.
jqyp324 yp wrote:
> James Chen wrote:
> > hammer is right.
> > Your question is too normal. Please refer to SpiderMonkey document.
>
> i think use jab call android/ios camera,mic etc…
>
> how do ? js > c++> java/oc ?

think you , now ,i doubt there will be no

However, I do not own bindings, the document is not very wide, it is best to call each other to have a demo

i done…

Could you show your results and how to achieve it?

@jqyp324 Hi, we have the same problem but Calling the Mail system, ¿how do you call native code? It’s all time Crashing!!