Current User

Provides access to the current user's information.

Properties inherited from class blackberry.bbm.platform.users.BBMPlatformUser:
String appVersion
Number bbmsdkVersion
String displayName
String handle
String personalMessage
String ppid
String status
String statusMessage

getDisplayPicture()

Gets the user's display picture.

Synopsis:

void blackberry.bbm.platform.self.getDisplayPicture(onComplete)

Parameters:

onComplete {Function}

Invoked when the image has been retrieved.

image {String}

Contains a base64 string representation of the image.

Example:

<script type="text/javascript">

    // Get the user's display picture
    blackberry.bbm.platform.self.getDisplayPicture(function (image) {
        // do something with the image here
    });

</script>
            

setDisplayPicture()

Sets the user's display picture from a URI. A dialog appears and allows the user to accept or cancel the change. Note that the display picture cannot exceed 32KB.

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 a BB10 device (e.g., "file:///accounts/1000/shared/photos/smiley.jpg")

Synopsis:

void blackberry.bbm.platform.self.setDisplayPicture(displayPictureURI, onSuccess, onError)

Parameters:

displayPictureURI {String}

The fully qualified URI.

onSuccess {Function}

Invoked when a photo is found at the path provided.

success {Boolean}

True if the image was found.

onError {Function}

Invoked when there was an error setting the picture.

error {String}

Contains the error message.

Example:

<script type="text/javascript">

    // Set the user's display picture
    blackberry.bbm.platform.self.setDisplayPicture("local:///smiley.jpg", 
       function (success) {
        alert("Image found");
    }, function (error) {
        alert(error);
    });

</script>
            

setPersonalMessage()

Sets the user's personal message. A dialog appears and allows the user to accept or cancel the change.

Synopsis:

void blackberry.bbm.platform.self.setPersonalMessage(personalMessage, onComplete)

Parameters:

personalMessage {String}

The personal message. The maximum length is 160 characters; anything over will be truncated. If null is provided, then the personal message is cleared.

onComplete {Function}

Invoked if the user dismissed the dialog, either by accepting or canceling.

accepted {Boolean}

True if the user accepted the change; False otherwise.

setStatus()

Sets the user's status. A dialog appears and allows the user to accept or cancel the change.

Synopsis:

void blackberry.bbm.platform.self.setStatus(status, message, onComplete)

Parameters:

status {String}

The status: one of "available" or "busy".

message {String}

The optional status message. If not provided, the default message of either "Available" or "Busy" will be used.

onComplete {Function}

Invoked if the user dismissed the dialog.

accepted {Boolean}

True if the user accepted the change; False otherwise.

appVersion

The version of this BBM Connected Application that the user is running.

Synopsis:

readOnly
String CurrentUser.appVersion

bbmsdkVersion

The version of the BBM SDK that the user is running.

  • BBM SDK 1.0: 100
  • BBM SDK 1.2: 120
  • BBM SDK 1.3: 130
  • BBM SDK 2.0: 200

Synopsis:

readOnly
Number CurrentUser.bbmsdkVersion

displayName

The display name.

Synopsis:

readOnly
String CurrentUser.displayName

handle

A unique ID representing the user on a specific device. A user with more than one device will have a different handle on each one.

Synopsis:

readOnly
String CurrentUser.handle

personalMessage

The personal message.

Synopsis:

readOnly
String CurrentUser.personalMessage

ppid

A unique ID representing the user on all devices. A user with more than one device will have the same ppid on each one.

Synopsis:

readOnly
String CurrentUser.ppid

status

One of "available" or "busy".

Synopsis:

readOnly
String CurrentUser.status

statusMessage

The status message.

Synopsis:

readOnly
String CurrentUser.statusMessage

Last modified: 2014-09-29



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus