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
Highlighted
New Developer
Posts: 77
Registered: ‎09-02-2010
My Device: torch
My Carrier: blackberry developer
Accepted Solution

How to get chat facility using BBM after Integration with third party app.

Hi There,

 

I have downloaded BBM SDK1.3 and added to my app. I have used following code to integrate BBM with my application.

 

BBMBridge bridge = BBMBridge.getInstance();
                      BBMPlatformContext platformContext = bridge.getBBMPlatformContext();
                      // configure listeners for the context
                      MyBBMPlatformContextListener contextListener = new MyBBMPlatformContextListener();
                      platformContext.setListener( contextListener );

 

here how to get chat facility, invite frieds...etc of like all BBM features. Once after BBM verified successfully, if I click the same button to reopen nothing getting open. Do I need to write any thing more. Please help me in this regard. If could provide any related code to get this process would be appreciated.

 

Please give me detailed explanation.

Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: How to get chat facility using BBM after Integration with third party app.

Hi Harinadh,

 

Please find the attached tictactoe example for your requirements and also for dependency checker.

 

 

Thanks.

New Developer
Posts: 77
Registered: ‎09-02-2010
My Device: torch
My Carrier: blackberry developer

Re: How to get chat facility using BBM after Integration with third party app.

Hi Pradeep challa

Thanks for your reply

I Need to fetch the BBM contacts available in my device. For this I am giving here a segregated code.

 

 BBMBridge bridge = BBMBridge.getInstance();
                      BBMPlatformContext platformContext = bridge.getBBMPlatformContext();
                      MyBBMPlatformContextListener contextListener = new MyBBMPlatformContextListener();
                      platformContext.setListener( contextListener );

 

BBMBridge and MyBBMPlatformContextListener are my customized classes where I have given UUID and contextlisteners.

By using BBMplatformcontext object, I want to fetch the available contacts in my device

 

 

 

For this I have written the below code,

 

 ContactListService contactListService = platformContext.getContactListService();
        BBMPlatformContactList contacts = contactListService.getContactList();
        Enumeration contactsEnum = contacts.getAll();
        while(contactsEnum.hasMoreElements())
        {
            BBMPlatformContact contact = (BBMPlatformContact)contactsEnum.nextElement();
             add(new LabelField(contact.getDisplayName()));
        }

 

where its not  showing anything. .i.e not fetching the BBM contacts where my device has 5 more BBM Contacts.

 

 

As you suggested I have followed the SDK documents along with below link

http://docs.blackberry.com/en/developers/deliverables/34924/Send_direct_msg_to_contact_1434047_11.js...

 

Please let me know if i am wrong.

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to get chat facility using BBM after Integration with third party app.

You seem to want to get a list of the BBM contacts on your phone. This is not supported.  The only 'list' you can get on your phone is a list of other BBM contacts who have your Application installed. 

 

Are you trying to start a normal BBM chat or an 'in application' chat. 

 

The sample BBM applicatin supplied with the SDK actuially demonstrates both these functions.  I recommend that you review the code in that application. 

New Developer
Posts: 77
Registered: ‎09-02-2010
My Device: torch
My Carrier: blackberry developer

Re: How to get chat facility using BBM after Integration with third party app.

Hi Peter

 

Thanks for your reply!!

 

I am not starting BBM chat or 'in application chat'. I am activating MessagingService by using BBMPlatformContext object. For this, I wanna get all the BBM contacts available in device. But I could not get any contact except the contact that has my application installed.

 

If could observe, there is application called 'screen muncher' where there are fetching all the BBM contacts eventhough application is not installed in their devices. How could this be possible.

 

Even I have gone through SDK 1.0 & 1.3 demo pdf files like http://docs.blackberry.com/en/developers/deliverables/34925/BlackBerry_Messenger_SDK-Development_Gui... Even there I could not find anything.  May I know your explanation about this 'screen muncher'.

 

Looking forward for your response.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to get chat facility using BBM after Integration with third party app.

Screen Muncher does not actually get all the contacts.  It makes a request to BBM and supplies the data to be shared.  The Select Contact screen that you see is not running inside Screen Muncher, it is BBM supplied code.  So Screen Muncher does not get access to the contacts that are displayed on the screen.

 

You can see the same sort of thing when you test out the BBM SDK.

 

"I wanna get all the BBM contacts available in device. But I could not get any contact except the contact that has my application installed."

 

What you are seeing is correct. 

New Developer
Posts: 77
Registered: ‎09-02-2010
My Device: torch
My Carrier: blackberry developer

Re: How to get chat facility using BBM after Integration with third party app.

Hi Simon

 

Thank you so much for your much confirmed answer.