On Wed, Nov 27, 2013 at 05:56:17AM +0000, Gao, Shawn wrote:
> Hi,
> Messaging Api has following definitions.
> *       xwalk.experimental.messaging.findMessages()
> *       xwalk.experimental.messaging.sms.send()
> But for xwalk extension, there is only way to export api, 
> "exports.findMessage = function(){}". If I want to bind a function to 
> exports.sms like this,
>         exports.sms = {}
>         exports.sms.send = function(){}
> I meet this error,
>         11-27 04:05:39.460: I/chromium(14562): [INFO:CONSOLE(28)] 
> "xwalk.experimental.messaging.sms:undefined", source: file:///data/1.html (28)

What is the extension name in this case? If it is
"xwalk.experimental.messaging", your code should be working, so this
is probably a bug. Are you sure extension code is being loaded
correctly?

You can also point me to code or a PR that I can help more
effectively.


> Finally, I found this solution can work,
>       xwalk.experimental.messaging = new Object();
>       xwalk.experimental.messaging.sms = new SmsManager();
>       xwalk.experimental.messaging.sms.send = function(){}
> Of cause, that's break the boundary between extension to outer javascript 
> namespace.

In cases where you want to expose things outside your own "extension
name", you can do, but also need to declare these other "entry points"
in C++ code. This feature is still experimental, you can find examples
in xwalk/extensions/tests/ (with the C API).


Cheers,
Caio
_______________________________________________
Crosswalk-dev mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-dev

Reply via email to