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
Developer
Posts: 653
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers
Accepted Solution

BB10 - How to Launch App World from Javascript?

Has anyone launched App World to one title from javascript.  I tried this on dev alpha and it isn't working :

 

function openWebLinkInBrowser(URL) {
    // open web link in browser
    blackberry.invoke.invoke({
        target: "sys.browser",
        uri:URL
    }, onInvokeSuccess, onInvokeError);
}



function appWorld(appId)
{
   try 
   {
	
	var url = "http://appworld.blackberry.com/webstore/content/" + appId;
	openWebLinkInBrowser (url) ; 
	
	
   } 
   catch (e) {
	showCustomToast("There was a problem launching App World", "OK");
   }
}

 


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Contributor
Posts: 33
Registered: ‎09-19-2011
My Device: playbook
My Carrier: none

Re: BB10 - How to Launch App World from Javascript?

This works in playbook to open at a specific app.

 

var url = "http://appworld.blackberry.com/webstore/content/103601";
       
    try {
        var args = new blackberry.invoke.BrowserArguments(url);
        blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
    }
    catch (e) {
        alert('exception (Appworld): ' + e.name + '; ' + e.message);
    }
}

Developer
Posts: 653
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: BB10 - How to Launch App World from Javascript?

I use something similar to this in Cascades and it works.....but not working in Webworks.....perhaps I have a parameter wrong :

 

var request = {
"type": "application/x-bb-appworld",
"uri": "appworld://content/12603",
"action": "bb.action.OPEN",
"action_type": "ALL"
};
blackberry.invoke.query(request, onInvokeSuccess, onInvokeError);

 

 

 


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 - How to Launch App World from Javascript?

Here is some documentation from Cascades that describes the invoke targets... https://developer.blackberry.com/cascades/documentation/device_platform/invocation/blackberry_world....

 

You can do it by issueing the following which is an un-bound. As you can see from the documentation you can also add in the target if you wish, but the uri protocol is the important part.

 

blackberry.invoke.invoke({
    "uri": "appworld://content/12603",
    "action": "bb.action.OPEN", 
    "action_type": "ALL"
})

Please replace the 12603 with the content you wish to show.

@erikjohnzon
erjohnson@blackberry.com