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
Posts: 7
Registered: ‎10-24-2011
My Device: 9900
My Carrier: Vodafone

Display a dialog box on home screen

Hi everyone,

 

I am developing an application which will alert the user when the data is pushed. I  want to send a dialog like alert to users home screen without opening the the actual application. The dialog will display the information to the user and if he selects OK it will open the app and if he selects close it will just ignore the message.

 

So far i have done this when the push is initialized

blackberry.app.requestForeground()

var ss = ["OK", "Close"];
blackberry.ui.dialog.customAsk("push data push data", ss, 0, true);

The problem is it opens up the whole app and then displays the dialog. I dont want to hog users whole screen; just want to display the dialog on home screen. Any ideas how can i accomplish that fellas?

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Display a dialog box on home screen

Hi zed_one,

I'd reccomend using the showBanner API - https://bdsc.webapps.blackberry.com/html5/apis/blackberry.app.html#.showBannerIndicator

This will add an indicator just like your native email or BBM. This way your app will feel just like a native app.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
New Contributor
Posts: 7
Registered: ‎10-24-2011
My Device: 9900
My Carrier: Vodafone

Re: Display a dialog box on home screen

Hi effheifetz,

 

Good advice but i really need to implement this. The app is for news and only the stories of very high importance will be pushed which will happen like maybe twice or thrice a week. I got this idea from AP's news app and i really need to implement this feature in my app. I hope there is a way to do this.

New Contributor
Posts: 7
Registered: ‎10-24-2011
My Device: 9900
My Carrier: Vodafone

Re: Display a dialog box on home screen

I was able to display a dialog box on home screen with the help of this.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

 

but i cant figure out how to implement this in webworks. Help me please.

Trusted Contributor
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: Display a dialog box on home screen

you can write an extension that implements this code and use it from javascript

New Contributor
Posts: 7
Registered: ‎10-24-2011
My Device: 9900
My Carrier: Vodafone

Re: Display a dialog box on home screen

how can i do that?

 

the class is as follows:

public class HelloWorld extends Application
{
        public static void main(String[] args)
        {        
    
                HelloWorld theApp = new HelloWorld();

                   UiEngine ui = Ui.getUiEngine();
                Screen screen = new Dialog(Dialog.D_OK, "Look out!!!", 
                    Dialog.OK,           Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION),         Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);

                theApp.enterEventDispatcher();
                }        
       
}

 

 

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Display a dialog box on home screen

Hi zed_one,

 

If you take a look at the barcode extension on our community repo, you'll see the scanBarcodeAction does just this, it creates a screen and pushes it. If you modify the code with your own it shouldn't be too hard to get working.

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/Smartphone/Barcode/webworks/media/...



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
New Contributor
Posts: 7
Registered: ‎10-24-2011
My Device: 9900
My Carrier: Vodafone

Re: Display a dialog box on home screen

Thanks for the link, didn't knew about the APIs in github. Found a couple of other useful APIs there.