Question

In my WebWorks application I have the following in my config.xml;

<feature id="blackberry.invoke.card" />

and in my main page I imported the following JS: `

    <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js" type="text/javascript"></script>
    <script src="js/BlackBerry-JQM-Init.js" type="text/javascript"></script> 
    <script src="js/BlackBerry-JQM.js" type="text/javascript"></script>
    <script src="local:///chrome/webworks.js" type="text/javascript"></script>
    <script src="js/index.js" type="text/javascript"></script>

`

But whenever the code attempts to run blackberry.invoke.card.invokeEmailComposer(...) I get "blackberry is not defined". What am I missing to properuly use the Blackberry libraries, specifically to send an email message? All the examples from Github and other sites also failed to work.

Was it helpful?

Solution

Edit: Re-wrote since you're using WebWorks 2.0 Beta

I see the problem. You're doing things the "old way".

Since WebWorks 2.0 is running on Cordova, a few things have changed. Really quickly, I can see that you're including the 'local:///webworks.js'. That is incorrect for v2.0.

You need to include cordova.js now. Take a look at the sample project that comes with WebWorks 2.0 when you create a new project.

Here's the full Getting Started Guide that should get you up to speed. If you would rather use the command line, take a look at the build instructions at the end of any of the sample apps. Again, feel free to reference or use and adapt any of the sample apps as well @ https://github.com/blackberry/BB10-WebWorks-Samples/tree/WebWorks-2.0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top