Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
sanj1504
Posts: 107
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none

calling core c++ function from javascript other than "navigator.cascades.postMessage"

Hi,

 

I have to call a c++ function from javascript and that function will return me a value which i have to use in my javascript (after call to c++ native). Is it possible to get the return value from navigator.cascades.postMessage function. Or there is some other way. 

 

Please help !!!!!!!

 

Regards,

Sanjeev

Please use plain text.
Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: calling core c++ function from javascript other than "navigator.cascades.postMessage"

You can do two way communication between a webview and the navigator.cascades object in JavaScript. This page has an example:

 

https://developer.blackberry.com/native/documentation/cascades/ui/webview/javascript.html

 

Basically, navigator.cascades.postMessage in JS will trigger the onMessageReceived slot on the webview. And when you call postMessage on your webview, it will call the function you assigned to navigator.cascades.onmessage in JS.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Please use plain text.