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
sindhuja
Posts: 3
Registered: ‎09-29-2012
My Device: -

Closing Browser Session in Blackberry by Code

Hi 

I am developing a mobile application using SAP BSP ( ABAP + HTML and CSS ) . this application is for Blackberry users in my corporate. I am not able to close the browser session running the the blackberry.

 

I tried with Window.Close() ; / system.exit(0); inside javascript.. but its not working. 

 

Can you please tell me what is the command that needs to be provided to close the browser in blackberry phones

If there is a possibility to clear the cache / cookies using code for blackberry phones also will help.

 

I will appreciate if any body could help me.


Thanks

 

 

 

Developer
nunodonato
Posts: 313
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha

Re: Closing Browser Session in Blackberry by Code

Are you packaging a webworks app or just opening a page in the browser?

Nuno
theBBthing.wordpress.com - my BlackBerry development blog: news, tips and tutorials
bitoutsidethebox.com - re-imagining digital solutions


Developer
interfaSys
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,

Re: Closing Browser Session in Blackberry by Code

[ Edited ]

Closing the app

https://developer.blackberry.com/html5/apis/blackberry.app.html#.exit

 

About the cache

https://developer.blackberry.com/html5/apis/blackberry.widgetcache.html

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Closing Browser Session in Blackberry by Code

I think nuno and olivier are on the right track.  Sundhuja - you cannot close the native browser application using JavaScript.  the window.close() method is effectively ignored.  It may allow you to close an open tab, but not the actual browser application itself.

 

However if you are building a WebWorks application, you can use the blackberry.app.exit() method.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
sindhuja
Posts: 3
Registered: ‎09-29-2012
My Device: -

Re: Closing Browser Session in Blackberry by Code

Hi Nuno,

 

I am not developing application on webworks, i am working on SAP platform , Creating a web application which can be run on any browser. The issue iam facing is iam not able to logoff the application , i tried closing the browser window using "window.close" javascript command which is working on IE browser , same as you mentioned is not working on blackberry phones. Do you know how i can make it work on BB? without going to webworks?

Developer
Nitish_Pheonix
Posts: 29
Registered: ‎09-17-2012
My Device: 9810, 9800, 9700, 9900, 9300

Re: Closing Browser Session in Blackberry by Code

Hi Sindhuja,

Use this code...

blackberry.app.exit();

 May be this will help you.

Thanks & Regards,
Nitish_Pheonix

Hit like if the above post is helpful to you.
Please Accept this as Solution if the above post is a solution for you.
New Contributor
sindhuja
Posts: 3
Registered: ‎09-29-2012
My Device: -

I tried using blackberry.app.exit() , did not work. I am not developing any application on webworks , iam working on SAP platform , developed a web application which is run on a blackberry.