BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 01-27-2012, 07:12 PM   #1
bassplayerpatrick
New Member
 
Join Date: Jan 2012
Model: 8520
PIN: N/A
Carrier: vodafone
Posts: 2
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, 10:48 PM   #2
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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, 04:59 AM   #3
bassplayerpatrick
New Member
 
Join Date: Jan 2012
Model: 8520
PIN: N/A
Carrier: vodafone
Posts: 2
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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 06: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 08:44 AM


5Pcs 1000V 50A Metal Case Single Phase Diode Bridge Rectifier KBPC5010 5X picture

5Pcs 1000V 50A Metal Case Single Phase Diode Bridge Rectifier KBPC5010 5X

$9.89



10Pcs 1000V 50A Metal Case Single Phase Diode Bridge Rectifier KBPC5010 10X picture

10Pcs 1000V 50A Metal Case Single Phase Diode Bridge Rectifier KBPC5010 10X

$15.49



MDQ 100A Amp 1600V Volt Single 1 Phase Diode Metal Case Bridge Rectifier TS picture

MDQ 100A Amp 1600V Volt Single 1 Phase Diode Metal Case Bridge Rectifier TS

$10.49



AVR Automatic Voltage Regulator Rectifier Single Phase For 2KW 3KW Generator picture

AVR Automatic Voltage Regulator Rectifier Single Phase For 2KW 3KW Generator

$8.71



100pcs 1N4007 IN4007 1A 1000V Rectifier Diode DO-41 Axial 1Amp 1000 Volt picture

100pcs 1N4007 IN4007 1A 1000V Rectifier Diode DO-41 Axial 1Amp 1000 Volt

$4.73



1N5408 IN5408 (10 pcs) 3A 1000V Rectifier Diode - USA Ship picture

1N5408 IN5408 (10 pcs) 3A 1000V Rectifier Diode - USA Ship

$6.32







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