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

Web and WebWorks Development

Reply
Highlighted
New Contributor
Posts: 2
Registered: ‎07-09-2014
My Device: Z10
My Carrier: 441344305476
Accepted Solution

Camera invoke issue - Work Space only

[ Edited ]

I cannot invoke the Camera application to take a picture whilst in the Work space.  It works fine in personal.

 

I have tried both the cordova plugin and also the webworks invokeCamera methods.  Both calls result in an INVOKE_NO_TARGET_ERROR being thrown when in the work space.

 

To recreate this error create a simple test project and add the following code on device ready or a button press.

 

var mode = blackberry.invoke.card.CAMERA_MODE_PHOTO;
        blackberry.invoke.card.invokeCamera(mode, function (path) {
            alert("saved "+ path);
            },
            function (reason) {
                alert("cancelled " + reason);
            },
            function (error) {
                if (error) {
                    alert("invoke error "+ error);
                } else {
                    console.log("invoke success " );
                }
        });

 

Then install and run it from the work space.

 

My guess is that the Camera card isn't accessible from the work space but I can't see any similiar issue raised, which you would think it would be as its quite a common requirement.

 

In the work space the camera is accessible and working from the bottom toolbar and isn't disabled by any BES policy  (as far as I can see!).  If someone could help it would be much appreciated as it has me stumped.

 

Platform details:

Webworks 2.1

BB10 Z10  - STL100-2

OS: 10.2.1.3247

 

UPDATE:

 

This webpage showcasing HTML5 camera input also shows the issue.  In personal it runs fine but if I open the app from the work space it fails to open the camera.

 

I just used the BB10 browser to open the page.

 

http://mobilehtml5.org/ts/?id=23

 

 

 

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Camera invoke issue - Work Space only

The Camera application does not exist in the Work Perimeter for security reasons. Though the Camera is accessible on the toolbar, note that its icon does not appear on the Work Perimeter side.

Check out this blog series here:
http://devblog.blackberry.com/?s=cloudy+pics

Part 4 in particular.

WebRTC can get you access to the camera stream, or you can invoke Cloudy Pics if it exists (many enterprise developers have gone that route.) Alternatively, you can follow the Cloudy Pics sample and implement your own version as well.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Contributor
Posts: 2
Registered: ‎07-09-2014
My Device: Z10
My Carrier: 441344305476

Re: Camera invoke issue - Work Space only

Thank you for responding.  That confirms what I thought.  Its a shame you can't just install the standard BB Camera app into the work space using BES somehow.