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

Java Development

Reply
New Developer
BBDev
Posts: 20
Registered: ‎07-17-2008
My Device: Not Specified

Issue in Notification Manager

I implemented NotificationsManager in my code as per defined in the BB Docs.

Issue is my app name is appearing on the profile list but in each profile by default volume comes silent/mute.

Any Idea?

 

Code snippet is here:

Register:

  private void registerNotificationObjects()
    {
        // A source is registered to tell the system that our application will
        // be sending notification events. This will will cause a new user
        // editable configuration to be added to the Profiles application.
        NotificationsManager.registerSource(_factory.getNotificationID(),
            new Object()
            {
                public String toString()
                {
                    if(_factory.getAppNameForNativeMessage()!= null){
                        return _factory.getAppNameForNativeMessage();
                    }
                    return _factory.getAppName();
                }
            }, NotificationsConstants.CRITICAL);

        // Our NotificationsEngineListener implementation will display a dialog
        // to the user when a deferred event is triggered.
        NotificationsManager.registerNotificationsEngineListener(_factory
            .getNotificationID(), new NotificationsEngineListenerImpl(this));

        // Our Consequence implementation will invoked whenever an immediate
        // event occurs.
        NotificationsManager.registerConsequence(_factory.getConsequenceID(),
            new ConsequenceImpl(_factory.getNotificationID()));
    }


//Start Notification

 

public void startNotification() {
        int trigger = NotificationsConstants.MANUAL_TRIGGER;

        // The timeout parameter is IGNORED unless the TRIGGER
        // is OUT_OF_HOLSTER_TRIGGER.
        long timeout = -1;

        Event e = new Event(_factory.getNotificationID(), _eventId, 500,
                timeout, trigger);
        _eventId++;
        e.fire();
    }

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,313
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Issue in Notification Manager

registerConsequence is used if your application will be handling the alert.  If you just want to use the system notifications (ring, vibrate, etc...) you can follow the implementation here.

 

Notifications Made Easy

http://supportforums.blackberry.com/t5/Java-Development/Notifications-Made-Easy/ta-p/520626#nobanner...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Contributor
bhanuprakashachary
Posts: 11
Registered: ‎01-30-2012
My Device: device field.
My Carrier: device field.

Re: Issue in Notification Manager

NotificationsManager.triggerImmediateEvent(ID, 0, null, null);

 

Call the above specified method when notification required.

Please use plain text.