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
Contributor
Posts: 38
Registered: ‎01-21-2012
My Device: Bold 9900
My Carrier: Iusacell

Error Signing my App for Smartphones with WebWorks and Ripple

[ Edited ]

Hi. I want to know if anyone can help me out. I have some problems with my App for Smartphones. The one for the PlayBook works like a charm and is the same code.

 

The issue goes in the index.html file. When i use this code:

[CODE]<!DOCTYPE html>
<html>
<body>
    <script>
        window.addEventListener("load", function(e) {
            
            //Open the URL
            var url = "http://www.myweb.com";
            var args = new blackberry.invoke.BrowserArguments(url);
            blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

            //close this app
            blackberry.app.exit();
        }, false);
    </script>
</body>
</html>[/CODE]

I'm not able to sign the app. But when i change the code to this:

[CODE]<!DOCTYPE html>
<html>
<body>
    <script>
        window.addEventListener("load", function(e) {
            
            //Open the URL
            var url = "http://www.myweb.com";
            var args = new blackberry.invoke.BrowserArguments(url);
            blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
    </script>
</body>
</html>[/CODE]

The signing works perfectly but i have closing issues when i load it to my Bold 9900. It runs well at the star but when i close it it stays on. I have to close it twice. :confused:

Hope you can help me out.

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Error Signing my App for Smartphones with WebWorks and Ripple

That's really interesting since the second sample source isn't quite well and would throw an error when running in the browser. You are adding the "load" event listener, but the function-call isn't closed as it should be, brackets are missing in the right way.

 

If you want to open a specific URL from your application, why not using the app, why you want to use the app to open the browser with the URL. A WebWorks app is running inside the browsers engine and you can link the config.xml to every endpoint URL you want to!

 

Ever tried something like this in your config.xml:

 

// open your external URL in the app container
<content src="http://www.myweb.com" type="text/html" />

// let the app container access your external URL + subdomains
<access subdomains="true" uri="http://www.myweb.com" />

 

For your blackberry.app.exit() issue not signing the app it sounds really strange. Can you provide some errors you are receiving when signing for smartphone?

 

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Contributor
Posts: 38
Registered: ‎01-21-2012
My Device: Bold 9900
My Carrier: Iusacell

Re: Error Signing my App for Smartphones with WebWorks and Ripple

Tyvm for your fast reply!

 

So if do that on my XML what do i have toi leave on the HTML so the app can run propertly?

 

Regards.

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Error Signing my App for Smartphones with WebWorks and Ripple

Give it a try using Ripple emulator in Chrome and you should see errors in the console if there are. If your app can run properly is a good question, but without any source of the page you want to open within an app or the browser it is hard to answer your question.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Contributor
Posts: 38
Registered: ‎01-21-2012
My Device: Bold 9900
My Carrier: Iusacell

Re: Error Signing my App for Smartphones with WebWorks and Ripple

Ok i will give it a try and let you know.

 

Thanks again.

Contributor
Posts: 38
Registered: ‎01-21-2012
My Device: Bold 9900
My Carrier: Iusacell

Re: Error Signing my App for Smartphones with WebWorks and Ripple

Ok. So i get the typical error that i always get on ripple when I click on Package & Launch.

 

"Oh Snap! Build request failed with message: parsererror"

 

The Simulators runs and i can see the app. I click on the icon but i just get a White Blank Screen.

 

This is my config.xml file:

 

<?xml version="1.0" encoding="UTF-8"?>
-<widget xml:lang="en" id="AlertaHuracan" version="1.0.0.0" xmlns:rim="http://www.blackberry.com/ns/widgets" xmlns="http://www.w3.org/ns/widgets"> <name>Alerta Huracan</name> <author>Medios Corp.</author> <description>Acceso Directo al Sitio de Alerta Huracan</description> <content type="text/html" src="http://www.alertahuracan.com"/> <access uri="http://www.alertahuracan.com" subdomains="true"/> <icon src="images/icon.png"/> <feature id="blackberry.invoke" version="1.0.0.0" required="true"/> <feature id="blackberry.invoke.BrowserArguments" version="1.0.0.0" required="true"/> <feature id="blackberry.app" version="1.0.0.0" required="true"/> </widget>

 

 

 

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Error Signing my App for Smartphones with WebWorks and Ripple

[ Edited ]

Hi mxberry. I tried it and also wrote an example to get it working. The small config.xml looks like this:

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xml:lang="en" id="AlertaHuracan" version="1.0.0.0" xmlns:rim="http://www.blackberry.com/ns/widgets" xmlns="http://www.w3.org/ns/widgets">
	<name>Alerta Huracan</name>
	
	<author>Medios Corp.</author>
	
	<description>Acceso Directo al Sitio de Alerta Huracan</description>
	
	<content type="text/html" src="index.html"/>
	
	<access uri="http://www.alertahuracan.com" subdomains="true"/>
	
	<icon src="images/icon.png"/>
</widget>

There I have defined to load an "index.html" that looks like the following loading your page content:

 

<!DOCTYPE html>
<html>
	<head>
		<title>MyTestApp</title>
		<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<script type="text/javascript">
			location.replace("http://www.alertahuracan.com");
		</script>
	</head>
	<body>
	</body>
</html>

It is showing you red page like this:

 

mxberry_page_redirect.jpg

 

With your Package+Launch error seems something went wrong. I do not use Ripple for packaging my apps here, I run "ant" commands on command line to do that since it is working for me to package BB10 and PlayBook with some configurations using one "ant" command for each only.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Contributor
Posts: 38
Registered: ‎01-21-2012
My Device: Bold 9900
My Carrier: Iusacell

Re: Error Signing my App for Smartphones with WebWorks and Ripple

Tyvm i will give it a try again.

Contributor
Posts: 38
Registered: ‎01-21-2012
My Device: Bold 9900
My Carrier: Iusacell

Re: Error Signing my App for Smartphones with WebWorks and Ripple

Hi again. I try to package & sign the app on Ripple but i get the same error.

 


Oh Snap! Build request failed with message: error

 

I'll try using th SDK and let you know what happen.

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Error Signing my App for Smartphones with WebWorks and Ripple

Hi mxberry.

 

I also use the SDK with some modified "ant" script taken from Phonegap/Cordova to build+deploy my apps to PB and BB10 device since I run into some problems using Ripple.

 

I also needed to register new keys to sign apps for BB10 but I'm not able to sign for both, BB10 and PB, using the same keys and I don't know why. I joined some other discussions and there are devs that are able to sign both with only one set of keys and I couldn't find the problem I'm having.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.