-
Notifications
You must be signed in to change notification settings - Fork 4
Initialize BandyerSDK
Kristiyan Petrov edited this page Jan 22, 2019
·
35 revisions
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
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);
}