BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 01-27-2012, 06:12 PM   #1 (permalink)
New Member
 
Join Date: Jan 2012
Model: 8520
PIN: N/A
Carrier: vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question how do i register my app with BBM?

Please Login to Remove!

Hi,

i'm playing around with the BB JDE 5.0.0 API and i'm trying to create an app that reacts when a BBM message is received.
I have looked at the example (TicTacToe) app which should explain this, but this app actually connects with another user first to initiate the interaction.
I just want to react on an incoming BBM message without knowing who sent it.
The API-docs do not make it very clear to me so i hope there's someone out here that can.
Here's a sample of my code which doesn't work:
Code:
// intentionally omitted imports to shorten post

public class BBMReact extends UiApplication
{
  public static void main(String[] args)
{
  // don't know if this is necessary, except when using a screen
  BBMReact bbmReact = new BBMReact();
  bbmReact.enterEventDispatcher();

  ApplicationDescriptor adBBMReact = ApplicationDescriptor.currentApplicationDescriptor();
  BlackBerryMessenger bbm = BlackBerryMessenger.getInstance();
  if (bbm != null)
  {
    bbm.addSessionRequestListener(new BBMReactRequestListener(), adBBMReact);
  }

  public BBMReact ()
  {
    // some constructor code (maybe a pushscreen or something)
  }
}

private class BBMReactRequestListener implements SessionRequestListener 
{
    
  public void sessionRequestAccepted( Session session ) 
  {
    session.addListener(new BBMReactSessionListener(), ApplicationDescriptor.currentApplicationDescriptor());
  }
}

private class BBMReactSessionListener implements SessionListener
{
  public BBMReactSessionListener()
  {
    // TODO Auto-generated constructor stub
  }

  public void messageDelivered(Session session, Message message)
  {
    // TODO Auto-generated method stub
  }

  public void messageQueuedForSend(Session session, Message message)
  {
    // TODO Auto-generated method stub
  }

  public void messageReceived(Session session, Message message)
  {
    // This is where the reaction should take place
    Dialog.alert("You've got a BBM message!");
  }

  public void messageSent(Session session, Message message)
  {
    // TODO Auto-generated method stub
  }

  public void sessionClosed(Session session)
  {
    // TODO Auto-generated method stub
  }
}
Where or what am i doing wrong? Plz, help me understand the BBM API
Offline  
Old 01-27-2012, 09:48 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default Re: how do i register my app with BBM?

Just off hand I would expect that what you are trying to do is not supported by the API. If it is, it would allow any BBM connected application to spy on other application traffic. Not normally the way RIM does things.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 01-30-2012, 03:59 AM   #3 (permalink)
New Member
 
Join Date: Jan 2012
Model: 8520
PIN: N/A
Carrier: vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Re: how do i register my app with BBM?

Quote:
Originally Posted by hrbuckley View Post
Just off hand I would expect that what you are trying to do is not supported by the API. If it is, it would allow any BBM connected application to spy on other application traffic. Not normally the way RIM does things.
Then how can one make an app that changes the LED color for different types of incoming messages like, for instance, Ponas LED (there are more).

I think the only way to establish such is when you register with the messaging apps (services) to "catch" an incoming message.

I want to learn how to do exactly that.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: how do i register my app with BBM?
Thread Thread Starter Forum Replies Last Post
Recurring App World Problem Satchurator BlackBerry Help 3 12-24-2011 05:48 AM
App 'Reinstall' only option & BBM Help Prox BlackBerry Help 1 10-14-2011 09:53 AM
App World - BB Podcast Issue jimfraser BlackBerry Help 0 10-04-2011 05:18 PM
BlackBerry App World 2.0 Unveiled; Includes Carrier Billing, BBID, and More Superh3ro General BlackBerry Discussion 0 06-17-2010 09:16 PM
I need help please -bbm IGEMZ General BlackBerry Discussion 6 12-19-2009 07:44 AM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.