Skip to content
Itgel G edited this page Jun 14, 2021 · 14 revisions

Step 1. Default configuration

  • brandCode - generated unique code of your brand
  • erxesApiUrl - erxes-api url // for opensource version
  • companyName - Your registered company name // for saas version
public class CustomActivity extends AppCompatActivity {
    Config config;
    @Override
    protected void onCreate(Bundle savedInstanceState) {

        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("email","[email protected]");
            jsonObject.put("phone","99887766");
            jsonObject.put("name","itgel");
        } catch (JSONException e) {
            e.printStackTrace();
        }
    
        String customData = String.valueOf(jsonObject);

        config = new Config
                .Builder(brandCode)
                .setApiHost(apiHost) // for opensource
                .setOrganizationName(companyName) // for saas
                .setEmail("[email protected]")
                .setPhone("12345678")
                .setCompanyData(customData)
                .setData(customData)
                .build(this);
    }
}

Step 2. Start chat

Call a chat with login form

public void onClick(View view) {
    config.Start();
}
Clone this wiki locally