
### Synerise Builder
Synerise builder class.

**Declared In:**  
`com.synerise.sdk.core.Synerise.Builder`

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-102">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-102-0" data-tab-group="tabgrp-102" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-102-1" data-tab-group="tabgrp-102">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-102-0" data-tab-group="tabgrp-102" data-tab-active="true">

```Java
public static class Builder
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-102-1" data-tab-group="tabgrp-102">

```Kotlin
static class Builder
```

</div>
</div>


**Properties:**  

| Property | Type | Optional | Default | Description |
| --- | --- | --- | --- | --- |
| **app** | Application | no | - | Application context |
| **apiKey** | String | no | - | Profile API Key (formerly Client). Can be retrieved from Synerise App |
| **applicationId** | String | no | - | Application ID |
| **baseUrl** | String | no | - | Base URL in the SDK. Can be null |
| **syneriseDebugMode** | Boolean | no | - | Debug mode flag |
| **notificationIcon** | int | no | R.drawable.synerise_ic_default_icon | Notification icon |
| **notificationIconColor** | int | no | R.color.syneriseGrayTranslucent | Notification color |
| **channelDefaultName** | String | no | - | Default notification channel name |
| **channelDefaultId** | String | no | - | Default notification channel ID |
| **channelHighPriorityName** | String | no | - | High priority notification channel name |
| **channelHighPriorityId** | String | no | - | High priority notification channel ID |
| **pushListener** | OnRegisterForPushListener | no | - | Push listener |
| **locationListener** | OnLocationUpdateListener | no | - | Location listener |
| **crashHandlingEnabled** | Boolean | no | - | Crash handling flag |
| **hostApplicationType** | HostApplicationType | yes | - | Host application type |
| **hostApplicationSDKPluginVersion** | String | yes | - | Synerise SDK plugin version in the host application |
| **setRequestValidationSalt** | String | yes | - | Synerise Profile salt string for request validation |
| **messagingServiceType** | String | yes | GMS | Use `GMS` for Google Mobile Services or `HMS` for Huawei Mobile Services |

**Initializers:**  

Start initializing Synerise SDK with this method.  
To get the Workspace API Key (formerly Business) and Profile API Key (formerly Client), sign in to your Synerise account and go to [Settings > API Key](https://app.synerise.com/spa/modules/settings/apikeys/list).  
Then, copy or generate a new API Key for the workspace and API Key for profiles.


<pre><code class="language-java">public static Builder with(Application app, String apiKey, String appId)</code></pre>



---

Use this method to finish the initialization process.


<pre><code class="language-java">public void build()</code></pre>



---

**Methods:**  


This method sets the icon that will be used as the small icon in notifications.  
It must be a drawable resource (not a mipmap) due to Android Oreo adaptive icons restrictions.


<pre><code class="language-java">public Builder notificationIcon(@DrawableRes int notificationIcon)</code></pre>



---

This method sets the notification icon and text color.  
`notificationIconColor` must be in ARGB format.


<pre><code class="language-java">public Builder notificationIconColor(int notificationIconColor)</code></pre>



---

This method enables/disables logcat logs from Synerise SDK.  
It is not recommended to use debug mode in the release version of your application.


<pre><code class="language-java">public Builder syneriseDebugMode(boolean syneriseDebugMode)</code></pre>



---

This method passes info about Users application crashes as dedicated events to the backend.  
It is recommended to use `SyneriseCrashHandling`.


<pre><code class="language-java">public Builder crashHandlingEnabled(boolean exceptionHandlerEnabled)</code></pre>



---

It is important to register your profiles for push messages, so Synerise SDK may ask you to register a profile for push notifications.  
This callback is called after the profile signs in, signs up, or deletes the account.


<pre><code class="language-java">public Builder pushRegistrationRequired(@NonNull OnRegisterForPushListener listener)</code></pre>



---

This callback is called on demand by push notification, so it may be called at any time.  
Check out the [sample application](https://github.com/Synerise/android-sdk/blob/master/sample/src/main/java/com/synerise/sdk/sample/App.java) for example usage and remember to send.


<pre><code class="language-java">public Builder locationUpdateRequired(@NonNull OnLocationUpdateListener listener)</code></pre>



---

You can provide your custom base URL to use your own API.  
  
You can use one of the constants:  
**SyneriseApiUrls.SYNERISE_AZ_API_URL** -  `https://api.snrapi.com`  
**SyneriseApiUrls.SYNERISE_AZU_API_URL** - `https://api.azu.snrapi.com`  
**SyneriseApiUrls.SYNERISE_GEB_API_URL** - `https://api.geb.snrapi.com`  


<pre><code class="language-java">public Builder baseUrl(String baseUrl)</code></pre>


---

You can provide your notification channel name.  
By default, the channel name is set to your application name.


<pre><code class="language-java">public Builder notificationDefaultChannelName(@NonNull String name)</code></pre>



---

You can provide your notification channel ID.


<pre><code class="language-java">public Builder notificationDefaultChannelId(@NonNull String channelId)</code></pre>



---

You can provide your High Priority notification channel name.  
From default, channel name is set to `<your application name> High Priority`


<pre><code class="language-java">public Builder notificationHighPriorityChannelName(@NonNull String name)</code></pre>



---

You can provide your High Priority notification channel ID.


<pre><code class="language-java">public Builder notificationHighPriorityChannelId(@NonNull String channelId)</code></pre>



---

You can set the Synerise SDK host application type.


<pre><code class="language-java">public Builder hostApplicationType(HostApplicationType type)</code></pre>



---

You can set Synerise the SDK plugin version of the host application.


<pre><code class="language-java">public Builder hostApplicationSDKPluginVersion(@NonNull String version)</code></pre>



---

---
---

## InitializationConfig
Configuration class for initialization of the SDK.

**Declared In:**  
`com.synerise.sdk.core.types.model.InitializationConfig`

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-103">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-103-0" data-tab-group="tabgrp-103" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-103-1" data-tab-group="tabgrp-103">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-103-0" data-tab-group="tabgrp-103" data-tab-active="true">

```Java
public class InitializationConfig
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-103-1" data-tab-group="tabgrp-103">

```Kotlin
class InitializationConfig
```

</div>
</div>


**Properties:**  

| Property | Type | Optional | Default | Description |
| --- | --- | --- | --- | --- |
| **salt** | String | no | - | [Simple Profile Authentication](/developers/mobile-sdk/user-identification-and-authorization/simple-authentication) salt |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

All the properties above are accessible by using getters.

</div></div></div>


**Methods:**  

There are getters and setters for the above properties.

---
---

## Settings
Class model for settings.

**Declared In:**  
`com.synerise.sdk.core.settings.Settings`

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-104">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-104-0" data-tab-group="tabgrp-104" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-104-1" data-tab-group="tabgrp-104">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-104-0" data-tab-group="tabgrp-104" data-tab-active="true">

```Java
public class Settings
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-104-1" data-tab-group="tabgrp-104">

```Kotlin
class Settings
```

</div>
</div>


**Properties:**
| Property | Type | Description |
| --- | --- | --- |
| **sdk** | GeneralSettings | [General settings](/developers/mobile-sdk/settings#general) - This group contains options related to the general functioning of mobile SDK |
| **notifications** | NotificationsSettings | [Notifications settings](/developers/mobile-sdk/settings#notifications) - This group contains options related to push notifications |
| **tracker** | TrackerSettings | [Tracker](/developers/mobile-sdk/settings#tracker) - This group contains options related to tracking the customer activities in a mobile application |
| **inAppMessaging** | InAppMessagingSettings | [In-app messaging](/developers/mobile-sdk/settings#in-app-messaging) - This group contains options related to the [in-app messages](/docs/campaign/in-app-messages) feature |
| **injector** | InjectorSettings | [Injector](/developers/mobile-sdk/settings#injector) - This group contains options related to displaying [campaigns](/docs/campaign/Mobile) |
  
**Note:**  
Learn more about settings [here](/developers/mobile-sdk/settings)

---
---

## TrackMode
This enum contains the values which set a mode for tracking component interactions from the `android.widget` package.

**Declared In:**  
`com.synerise.sdk.core.types.enums.TrackMode`

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-105">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-105-0" data-tab-group="tabgrp-105" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-105-1" data-tab-group="tabgrp-105">Kotlin</button></div>

<div class="tab-panel" data-tab-id="tabgrp-105-0" data-tab-group="tabgrp-105" data-tab-active="true">

```Java
public enum TrackMode
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-105-1" data-tab-group="tabgrp-105">

```Kotlin
public enum TrackMode
```

</div>
</div>


**Values:**

| Property | Description |
| --- | --- |
| **PLAIN** | Tracks screen-visits. Events are sent when onStart of activities/Fragments is called. |
| **FINE** | Tracks screen-visits and onClick events from components such as Buttons, ImageButtons, RatingBars |


**Methods:**  

There are no methods.

---
---
