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
Regular Contributor
annuk
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

Please use plain text.
BlackBerry Development Advisor
Nukul
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
Please use plain text.
Regular Contributor
annuk
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

Please use plain text.