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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 82
Registered: ‎09-26-2012
My Device: Torch 9800
My Carrier: NA

Invoke and BrowserArguments not working in BB10 Ripple

Hi,

 

I am trying to open the web browser in BB10 using invoke and Browser arguments as specified in the following link:

 

https://developer.blackberry.com/html5/apis/blackberry.invoke.html#.invoke^2

 

https://developer.blackberry.com/html5/apis/blackberry.invoke.browserarguments.html

My code:js

function openBrowser() {

	alert('in open browser');
	console.log('in open browser');
	var args = new blackberry.invoke.BrowserArguments('http://www.google.com');
	blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
	
	}

 My html:

<script id="browse" src="js/browse.js"></script>

<div id="foo" data-bb-type="context-menu">
		<div data-bb-type="action" data-bb-img="images/actionBar/cog_dark_theme.png" onclick="openBrowser();">
			OPEN BROWSER
		</div>
</div>

 But i get the following error:

 

Uncaught TypeError: undefined is not a function browse.js:5
openBrowser browse.js:5
onclick

 Where am I going wrong.

 

Regards,

Annuk

Retired
Posts: 115
Registered: ‎06-06-2011
My Device: 9800
My Carrier: Rogers

Re: Invoke and BrowserArguments not working in BB10 Ripple

for BB10 must use blackberry.invoke like this 

 

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

 

invoke a link you do this 

 

function openWebLink() {
    // open web link - allows the system to choose an appropriate target that handles http://
    blackberry.invoke.invoke({
        uri: "http://www.blackberry.com"
    }, onInvokeSuccess, onInvokeError);
}
@nukulb
Highlighted
Developer
Posts: 82
Registered: ‎09-26-2012
My Device: Torch 9800
My Carrier: NA

Re: Invoke and BrowserArguments not working in BB10 Ripple

Hi,

 

Thanks for your reply. Tried as you said.


When I run it in Ripple I get the following alert, but it does not open the url in a browser. Is it not possible to open the url in a browser in ripple.

 

Requested to invoke external application with the following arguments:
uri = http://www.blackberry.com

Regards,

Annuk