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

How to - Invite contacts to download your application using the BBM Social Platform for Java and WebWorks

by Retired on ‎07-12-2011 11:58 AM - edited on ‎07-20-2011 04:06 PM by BlackBerry Development Advisor (5,435 Views)

 

The BBM™ Social Platform offers the ability to invite BBM contacts to download the app that implements this feature.

 

Before you begin: Make sure you visit the BBM Social Platform Development page and download the SDK for either Java® or BlackBerry® WebWorks™.  Next, ensure that you’ve completed the task, Register your application with the BlackBerry Messenger, as described in the Development Guide.

 

Feature Overview

 

What the inviter sees

 

contactSelect.PNG   InviteToDownload.PNG

 

What the invitee sees:

 

InviteeAccept.PNG   InviteeAccept.PNG 



The feature is enabled via the method calls below in either Java or BlackBerry WebWorks.  For a fully working sample application, download the attached project archive for either Java or BlackBerry WebWorks.

 

Java

 

 MessagingService messagingService = platformContext.getMessagingService();

       messagingService.sendDownloadInvitation();

 

BlackBerry WebWorks

       var result = blackberry.bbm.platform.io.inviteToDownload(onComplete);

 

The first line in the Java code is just a call to the platform to obtain a reference to the Messaging Service and isn’t necessary in the BlackBerry WebWorks implementation.  The sendDownloadInvitation() and inviteToDownload() methods are where the magic happens.  The platform will automatically show the user a Contact Picker UI field populated with their BBM contacts who do not already have the app installed.  The user can select a contact or cancel if they changed their mind, either way, control is returned to your app as soon as the user makes a selection.  This method should always be called as a response to a specific user request to invite their contacts to download your application.

 

To see this code in action, download the attached archives which contain Java and BlackBerry WebWorks sample projects.


Users Online
Currently online: 24 members 1,394 guests
Please welcome our newest community members: