08-12-2011 12:47 AM
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)platformContac tList.getAll().nextElement(); MessagingService messagingService=platformContext.getMessagingServi ce(); 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!!
Solved! Go to Solution.
08-12-2011 10:44 AM - edited 08-12-2011 10:50 AM
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. ![]()
08-14-2011 08:43 PM
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,"");
08-23-2011 03:27 PM