Current User

Provides access to the current user's information.

Supported Platform(s)

- BlackBerry OS 5.0+

View Supported Platform Table

APIOS 5.0OS 6.0OS 7.0PlayBookRipple
setDisplayPicture Y Y Y   
setPersonalMessage Y Y Y   
setStatus Y Y Y   

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:


You must declare the feature element(s) below in your configuration document:

Feature IDOS 5.0OS 6.0OS 7.0PlayBookRipple
<feature id="blackberry.bbm.platform" /> Y Y Y   

Permission Elements (PlayBook Only)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

setDisplayPicture


static void setDisplayPicture(displayPictureURI : String, onComplete : Function)

Supported Platform(s)

 - BlackBerry OS 5.0+

Description

Sets the user's display picture from a URI. A dialog will be presented to the user to allow or deny the change.

The URI must be fully qualified. Non-local URIs must be whitelisted in the application's configuration file. Examples:

  • Locally from within the widget package (e.g. "local:///smiley.jpg")
  • From the filesystem of the device (e.g. "file:///SDCard/BlackBerry/pictures/smiley.jpg")



Parameter Type Description
displayPictureURI String The fully qualified URI.
onComplete Function(accepted : Boolean) Invoked when the user has dismissed the dialog.

accepted: true if the user allowed the change; false otherwise.

Code Example(s)

<script type="text/javascript">
// Set the user's display picture
blackberry.bbm.platform.self.setDisplayPicture("local:///smiley.jpg", function(accepted) {
    if(accepted) {
        // User allowed the change
    } else {
        // User denied the change
    }
});
</script>

setPersonalMessage


static void setPersonalMessage(personalMessage : String, onComplete : Function)

Supported Platform(s)

 - BlackBerry OS 5.0+

Description

Sets the user's personal message. A dialog will be presented to the user to allow or deny the change.



Parameter Type Description
personalMessage String The personal message. The maximum length is 64 characters; anything over will be truncated. If null is provided then the personal message will be cleared.
onComplete Function(accepted : Boolean) Invoked when the user has dismissed the dialog.

accepted: true if the user allowed the change; false otherwise.

setStatus


static void setStatus(status : String, [message: String], onComplete : Function)

Supported Platform(s)

 - BlackBerry OS 5.0+

Description

Sets the user's status. A dialog will be presented to the user to allow or deny the change.



Parameter Type Description
status String The status: one of "available" or "busy".
message String
Optional
The optional status message. If not provided then the default message of either "Available" or "Busy" will be used.
onComplete Function(accepted : Boolean) Invoked when the user has dismissed the dialog.

accepted: true if the user allowed the change; false otherwise.

Code Example(s)

<script type="text/javascript">
// Set the user's status and status message
blackberry.bbm.platform.self.setStatus("busy", "Playing Tic-Tac-Toe!", function(accepted) {
    if(accepted) {
        // User allowed the change
    } else {
        // User denied the change
    }
});
</script>

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 13:31:20 GMT-0500 (EST)