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
New Contributor
Posts: 9
Registered: ‎07-09-2013
My Device: Z10 LE
Accepted Solution

INVOKE_BAD_REQUEST_ERROR

I'm getting this error while using share invocation: INVOKE_BAD_REQUEST_ERROR
Trying to share 1.wav in my apps's folder sounds.


Code:

 function psound()

        {            blackberry.invoke.invoke({

                                     uri: "file:///sounds/"+1+".wav"

                                     }, onSuccess, onError);

        

          

        }

            function onSuccess() {

                alert("<p>Invocation successful</p>");

            }

            function onError(error) {

                alert("<p>Invocation error: " + error + "</p>");

            }

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

Re: INVOKE_BAD_REQUEST_ERROR

The invoke API is primarily intended to pass data to other applications; for sharing, did you mean to use the invokeTargetPicker API?

https://developer.blackberry.com/html5/apis/blackberry.invoke.card.html#.invokeTargetPicker

 

(i.e. share the WAV file over email, BBM, etc.)?


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: 9
Registered: ‎07-09-2013
My Device: Z10 LE

Re: INVOKE_BAD_REQUEST_ERROR

Yes for sharing .wav files over BBM, whatsapp, etc. So what kind of code should I use?

New Contributor
Posts: 9
Registered: ‎07-09-2013
My Device: Z10 LE

Re: INVOKE_BAD_REQUEST_ERROR

function onInvokeSuccess (msg) {
    console.log("Invocation Success" + msg);
}

function onInvokeError (msg) {
    console.log("Invocation Error: " + msg);
 }

function shareCardWav() {
    var request = {
            action : 'bb.action.SHARE',
            uri : 'local:///sounds/1.wav',
            target_type: ["CARD"]
        };

     blackberry.invoke.card.invokeTargetPicker(request, "Share Card Sound", onInvokeSuccess, onInvokeError);
}

 

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

Re: INVOKE_BAD_REQUEST_ERROR

That looks about right; is it working for you?


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: 9
Registered: ‎07-09-2013
My Device: Z10 LE

Re: INVOKE_BAD_REQUEST_ERROR

It says invocation successful and even the screen with whatsapp, bbm, email opens up but when you click on any of them nothing further opens. 

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

Re: INVOKE_BAD_REQUEST_ERROR

Are you testing on a physical device, simulator, or Ripple? Also, which version?


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: 9
Registered: ‎07-09-2013
My Device: Z10 LE

Re: INVOKE_BAD_REQUEST_ERROR

Device: Z10: 10.1

Like when I click on any of the apps in the share list nothing happens and the share list closes, but my alert says invocation successful. Do I need some file share permissions here?

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

Re: INVOKE_BAD_REQUEST_ERROR

[ Edited ]

All you should need is this <feature> in config.xml.
<feature id="blackberry.invoke.card" />

 

I will try a test here in the meantime 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: 9
Registered: ‎07-09-2013
My Device: Z10 LE

Re: INVOKE_BAD_REQUEST_ERROR

Yes permission has been included, emailing you my code. It seems in the app list, the listview is not getting selections.