- (void)viewDidLoad {
//openfire 连接状态通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openFireConnectState) name:BXOpenFireStateDidChangeNotification object:nil];
}
#pragma mark - openfireConnect Notice
- (void)openFireConnectState {
switch ([[[BXXmppClient shareXmppClient] openFireStateModule] openFireState]) {
case BXOpenFireStateUnconnect:{
[BXNavigationItemHelper setupTitleViewWithController:self title:NSLocalizedString(@"主页(未连接)", nil)];
} break;
case BXOpenFireStateConnecting: {
[BXNavigationItemHelper setupTitleViewWithController:self title:NSLocalizedString(@"主页(连接中)", nil)];
} break;
case BXOpenFireStateConnected: {
[BXNavigationItemHelper setupTitleViewWithController:self title:NSLocalizedString(@"主页", nil)];
} break;
case BXOpenFireStateConnectFail: {
[BXNavigationItemHelper setupTitleViewWithController:self title:NSLocalizedString(@"主页(未连接)", nil)];
} break;
}
}