Context

Since: BlackBerry 10.0.0

#include <bb/platform/bbm/Context>

To link against this class, add the following line to your .pro file: LIBS += -lbbplatformbbm

Represents a class that has the necessary context for access to the BBM Social Platform.

Creating a Context object initializes the BBM Social Platform for access. Calling requestRegisterApplication() registers your app with the BBM Social Platform. You can verify if your app has access to the BBM Social Platform by calling registrationAccessState(). RegistrationState::Allowed is returned if registration is successful. Once successfully registered, your app can use the BBM Social Platform APIs.


Overview

Public Functions Index

Context (const QUuid &applicationUuid=QUuid(), QObject *parent=0)
virtual ~Context ()
boolisAccessAllowed () const
boolisBbmSetup () const
intplatformVersion () const
bb::platform::bbm::RegistrationState::TyperegistrationState () const
Q_SLOT boolrequestRegisterApplication ()
Q_SLOT boolrequestRegisterApplicationSilent ()

Signals Index

voidregistrationStateUpdated (bb::platform::bbm::RegistrationState::Type state)

Public Functions

Context (

Creates a new Context object for your app.

The context object provides access to the BBM Social Platform APIs.

Parameters
applicationUuid

The UUID is a unique, 128-bit, 36-character identifier that you generate for your app using a UUID generator. The UUID string must conform to the Microsoft 8-4-4-4-12 format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). Valid characters consist of hexadecimal values in the ranges 0 to 9 and a to f.

A registration dialog may appear in your app after you invoke this function. The dialog indicates to the user that your app is connecting to BBM. The user must dismiss the dialog once registration is complete.
Parameters
parent

The QObject parent of this Context object.

See also:

QUuid

Since:

BlackBerry 10.0.0

virtual~Context ()

Destructor.

Since:

BlackBerry 10.0.0

bool isAccessAllowed ()

Verifies whether the registration state of your app is RegistrationState::Allowed.

Return:

true if the registration state is RegistrationState::Allowed, false otherwise.

Since:

BlackBerry 10.0.0

bool isBbmSetup ()

Determine if BBM is set up on the user's device.

Verifies whether the user has completed the set up of BBM on their device by signing in with their BlackBerry ID (Setup > BlackBerry Messenger).

Return:

true if the BBM is setup, false otherwise.

Since:

BlackBerry 10.2.0

int platformVersion ()

Retrieves the version of the BBM Social Platform.

The possible versions are: 200 - the second release of the BBM Social Platform for BlackBerry 10. Release date: June, 2013. 100 - the first release of the BBM Social Platform for BlackBerry 10. Release date: January, 2013. Also, the first release of the BBM Social Platform for BlackBerry Device Software version 5, BlackBerry 6, and BlackBerry 7. Release date: October, 2011.

120 - release for BlackBerry Device Software version 5, BlackBerry 6, and BlackBerry 7. Release date: November, 2011.

130 - release for BlackBerry Device Software version 5, BlackBerry 6, and BlackBerry 7. Release date: February, 2012. You can use the version number to check whether your application is compatible with this version of the BBM Social Platform.

Return:

The curent platform version number.

Since:

BlackBerry 10.0.0

bb::platform::bbm::RegistrationState::Type registrationState ()

Retrieves the registration state of your app.

Return:

The registration state, RegistrationState::Type.

Since:

BlackBerry 10.0.0

Q_SLOT bool requestRegisterApplication ()

Requests registration of your app with the BBM Social Platform.

A progress registration dialog may appear in your application after you invoke this function. The user can cancel registration by dismissing the dialog. Once registration is complete, a system toast may appear indicating to the user that your application is now connected to BBM. If registration does not complete successfully, a system dialog may appear informing the user about the reason for failure.

If BBM is not set up when registration starts, the user may decide to set up BBM. This action triggers registration to resume.

The signal registrationStateUpdated is emitted as an asynchronous response.

Return:

true if sending the request succeeds, false otherwise.

Since:

BlackBerry 10.0.0

Q_SLOT bool requestRegisterApplicationSilent ()

Requests registration of your app with the BBM Social Platform.

A UUID is a unique, 128-bit, 36-character identifier that you generate for your app using a UUID (or GUID) generator. The UUID string must conform to the Microsoft 8-4-4-4-12 format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). Valid characters consist of hexadecimal values in the ranges 0 to 9 and a to f.

Registration takes place in "silent" mode so that the registration progress dialog does not appear to the user after you invoke this function. Once registration is complete, a system toast appears to indicate to the user that your application is now connected to BBM. If registration does not complete successfully, no system dialog is displayed to inform the user about the reason for failure.

If permission to connect to BBM is not set up when registration starts, the user may decide to set up BBM. This action will cause registration to resume.

The signal registrationStateUpdated is emitted as an asynchronous response.

Return:

true if sending the request succeeds, false otherwise.

Since:

BlackBerry 10.2.0

Signals

void registrationStateUpdated (

Emitted when your app's access to the BBM Social Platform is updated.

Access to the BBM Social Platform APIs, afforded by the Context object, becomes available only after the registration access state changes to RegistrationState::AccessAllowed.

Parameters
state

bb::platform::bbm::RegistrationState.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus