Skip to content

Initialize BandyerSDK

Kristiyan Petrov edited this page Jan 22, 2019 · 35 revisions

Create a custom Application class

You can skip this step if you already have an Application class.

Create a java class in you package named App.java which must extend Application or MultiDexApplication

Link the newly created class App.java in the AndroidManifest.xml. See here for an example

Initialize BandyerSDK

In order to initialize the BandyerSDK correctly the following is required

  • Initialize a Builder with appId and Context
  • Add an environment (sandbox or production)
  • Add at least one module(call/chat) to the Builder
  • Pass as a parameter the newly created builder to the init method of BandyerSDK object.
@Override
public void onCreate() {
	super.onCreate();
	Context appContext = getApplicationContext();
	String appId = getString(R.string.app_id);

	BandyerSDK.Builder builder = new BandyerSDK.Builder(appContext, appId)
		.setEnvironment(Environment.Configuration.sandbox())
		.withCallEnabled() 
		.withChatEnabled();

	BandyerSDK.init(builder);
}

Optional&Advanced settings

Logging

Customize call module notifications

Customize chat module notifications

Clone this wiki locally