De gebruiker vragen om de BlackBerry Messenger-instellingen voor uw toepassing te wijzigen
De interface net.rim.blackberry.api.bbm.platform.BBMPlatformContext geeft een methode, requestAppSettings(), waarmee uw toepassing het scherm BBM™-opties naar voren kan halen zodat de gebruiker de instellingen voor de toepassing kan aanpassen. Dit is nuttig wanneer de toepassing bepaalde instellingen vereist, zoals een verbinding met BBM of weergave van een profielvak in het BBM-profiel van de gebruiker.
// Prompt the user to enable the profile box setting
private static void alertIfNotShowingProfile()
{
// Retrieve the settings manager associated with the application
final SettingsManager settings = context.getSettingsManager();
// Retrieve the profile box setting
final int profileBoxSetting =
settings.getSetting(SettingsManager.SETTING_PROFILE_BOX);
// If the profile box setting is disabled, ask the user to change the setting
if(profileBoxSetting == SettingsManager.VALUE_DISABLED)
{
if(Dialog.D_OK == Dialog.ask(Dialog.D_OK_CANCEL, "You have not enabled this
application to appear in your profile. Would you like to enable it?"))
{
// If the user agrees, bring up the BBM options screen
try
{
context.requestAppSettings();
}
catch(ControlledAccessException e)
{
// Code that runs when the BBM platform access status is not
// ACCESS_ALLOWED or is ACCESS_BLOCKED_BY_USER
}
}
}
}
Volgend onderwerp: Informatie verkrijgen over hoe uw toepassing binnen BlackBerry Messenger wordt aangeroepen
Vorig onderwerp: De openbare verbindingsinstelling voor uw toepassing ophalen