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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
itcraps
Posts: 229
Registered: ‎12-26-2010
My Carrier: Telus
Accepted Solution

Send Picture to BBM Contact

Hi All,

 

I am trying to send a picture file to BBM Contact using BBM SDK.

BBMPlatformContactList platformContactList=platformContext.getUIService().showContactPicker("Send Picture To:", ContactListProvider.BBM_CONTACTS_WITH_APP, false, false);
				
if(platformContactList.size()>0)
{
	BBMPlatformContact platformContact=(BBMPlatformContact)platformContactList.getAll().nextElement();
	MessagingService messagingService=platformContext.getMessagingService();
	messagingService.sendFile(platformContact, fileLocation, "Pencil Picture");
}

 It turned out that this line:

BBMPlatformContactList platformContactList=platformContext.getUIService().showContactPicker("Send Picture To:", ContactListProvider.BBM_CONTACTS_WITH_APP, false, false);

 only shows empty list..

 

Does this mean that I can only send pictures to users that have My Application installed, instead of showing all users in my BBM Contact?

 

Or is there anything i am doing wrong here?

 

Thanks!!

www.jackdevora.com
Please use plain text.
Developer
johanguzman07
Posts: 102
Registered: ‎07-26-2011
My Carrier: None

Re: Send Picture to BBM Contact

[ Edited ]

 Greetings.

The answer to both of your questions are: Yes and No.

That's a correct way to achieve what you want.

From now on, remember that, in order to interact with another user through your BBM enabled app, the other user is compelled to be a user of your app, as well.

Possible solution: send an invitation to the users you want to be connected to your app and then (after they accept the invitation) they will be shown in the contact picker.

To send the invitation use the BBMPlatformConnection implementers class (BBMPlatformSession or BBMPlatformChannel) sendInvitation() method, as follows:

 

BBMPlatformSession session = messagingService
                     .createSession(new MyBBMPlatformSessionListener());
UiApplication.getUiApplication.invokeLater(new Runnable() {
	public void run() {
		session.sendInvitation("Join to MyApp", "myAppCookie", 0);
	}
});

 

The send invitation method will throw a contact picker to select the users who will be invited from your BBM full contact list. That's why you have to surround the sendInvitation() call with the invokeLater() method.

 

I hope this be helpful. Let me know please. :Angel:


Let me know if this was helpful or if you have a solution.

Johan Guzmán - In case my answer pleased you, give a press to the LIKE button, please!! Mark this post as solution if it solved your problem.
Please use plain text.
Developer
StevenKader
Posts: 615
Registered: ‎02-03-2010
My Carrier: Rogers

Re: Send Picture to BBM Contact

The user should be able to send a file to any of their BBM contacts, even if they don't have your app.  I use this line of code to send files.  It will open up the contact picker of all of the users BBM contacts.  Once selected it will send the file.  Hope this helps.

 

_platformContext.getMessagingService().sendFile( filePath,""); 

 

 

 


Steven Kader at JaredCo
   Follow me on Twitter     BlackBerry Daily News

Feel free to press the like button to thank the user that helped you. Please mark posts as solved if you found a solution.
Please use plain text.
Trusted Contributor
itcraps
Posts: 229
Registered: ‎12-26-2010
My Carrier: Telus

Re: Send Picture to BBM Contact

Wow, I guess I should read the documentation carefully!! Thanks!!! Cheers
www.jackdevora.com
Please use plain text.