Results 1 to 6 of 6
  1.    #1  
    Hey so I'm having some issues with banner notifications in my app. I can get them to pop up but then they don't stay on the screen at the bottom... Could someone show me the code that they use for their notifications? Thanks!
  2. #2  
    Perhaps you're confusing banner notifications with a dashboard stage? If you want the small rectangular panel that you can be shown and then minimized back down to just the icon, you have to use a dashboard stage. Banner notifications inherently popup and then disappear.
  3. #3  
    You need to create a dashboard stage. Here's a snippet of what I use in my Notes app:

    var bannerParams = {messageText: $L('Uploading Note to Google Docs...') };
    this.appController.showBanner(bannerParams, {banner: "Google Upload"});

    this.notificationCreatedHandler = this.notificationCreated.bind(this);
    this.appController.createStageWithCallback(
    {name: "dashboard", lightweight: true},
    this.notificationCreatedHandler,
    "dashboard");

    }.bind(this), 1000);

    NoteAssistant.prototype.notificationCreated = function(stageController) {
    var data = { };
    stageController.pushScene('dashboard', data);
    }
    _____________________________________
    Inglorious Apps
    Developer of: Glimpse, Notes HD, Clipboard, Pix, Voices, Casa, Plickr, TweetCam, and Notes
  4.    #4  
    Quote Originally Posted by appsotutely View Post
    Perhaps you're confusing banner notifications with a dashboard stage? If you want the small rectangular panel that you can be shown and then minimized back down to just the icon, you have to use a dashboard stage. Banner notifications inherently popup and then disappear.
    Ah, yep that's what I was doing.
  5.    #5  
    Er, any idea how I would listen to when the user taps the notification?...
  6. #6  
    Quote Originally Posted by clacombe View Post
    Er, any idea how I would listen to when the user taps the notification?...
    If you mean tap on the dashboard stage, simply add an ID to your main div in your background and do:

    Code:
    this.myDashboardTapHandler = this.handleMyDashboardTap.bind(this);
    in your setup() method of your dashboard scene

    and

    Code:
    this.controller.listen("myDashboard", Mojo.Event.tap, this.myDashboardTapHandler);
    in your activate() method of your dashboard scene

    and

    Code:
    this.controller.stopListening("myDashboard", Mojo.Event.tap, this.myDashboardTapHandler);
    in your deactivate() method of your dashboard scene.


    ---------------------

    If you mean a tap on your banner notification, just add a third parameter to your dashboard and handle the response for that in your app assistant's "handleLaunch()" method.
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup

Posting Permissions