Skip to content

Module Observers

Kristiyan Petrov edited this page Jun 16, 2022 · 2 revisions

Module Observers

Call and chat modules can be observed adding a BandyerModuleObserver as shown below.

BandyerSDK.getInstance().addModuleObserver(new BandyerModuleObserver() {
	@Override
	public void onModuleReady(BandyerModule module) {
   		if (module instanceof ChatModule) {
   			Log.d(TAG, "chat module ready!");
   		} else if (module instanceof CallModule) {
   			Log.d(TAG, "call module ready!");
   		}
	} 

	@Override
	public void onModulePaused(BandyerModule module) {
   		Log.d(TAG, "module " + module.getName() + " paused.");
	}

	@Override
	public void onModuleFailed(BandyerModule module, Throwable throwable) {
   		Log.d(TAG, "module " + module.getName() + " failed with error " + throwable.getMessage());
	}

	@Override
	public void onModuleStatusChanged(BandyerModule module, BandyerModuleStatus moduleStatus) {
   		Log.d(TAG, "module " + module.getName() + " status change: " + moduleStatus);

	}
});
Clone this wiki locally