Invitation de l'utilisateur à modifier les paramètres de BlackBerry Messenger pour votre application
L'interface net.rim.blackberry.api.bbm.platform.BBMPlatformContext fournit une méthode requestAppSettings() qui permet à votre application de placer l'écran d'options BBM au premier plan pour que l'utilisateur puisse ajuster les paramètres de l'application. Ceci s'avère utile lorsque l'application nécessite certains paramètres précis, tels qu'une connexion à BBM ou l'affichage d'une zone de profil dans le profil BBM de l'utilisateur.
// 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
}
}
}
}
Sujet suivant: Obtention d'informations sur la façon dont votre application est appelée depuis BlackBerry Messenger
Ces informations vous ont-elles été utiles ? Envoyez-nous vos commentaires.