# EntryPoint

Source: https://docs.buzzvil.com/en/docs/buzzbenefit-android/v6/entrypoint
Platform: Android
SDK major version: v6
Language: English (en)
Translation: AI-translated from Korean. Original: https://docs.buzzvil.com/docs/buzzbenefit-android/v6/entrypoint

Learn how to add an entry point and implement additional features through the SDK interface.

## Key features

EntryPoint is an entry component that fits naturally into various locations in your app and gives users easy access to content. It supports a floating action button (FAB), Banner, BottomSheet, Popup, and Custom UI, allowing you to choose and position it to suit your design. Configure it through the Buzzvil Dash admin. Clicking it can open [BenefitHub](https://docs.buzzvil.com/en/docs/buzzbenefit-android/v6/benefithub), [Lucky Box](https://docs.buzzvil.com/en/docs/buzzbenefit-android/v6/benefithub#%EB%9F%AD%ED%82%A4%EB%B0%95%EC%8A%A4), or [Mission Pack](https://docs.buzzvil.com/en/docs/buzzbenefit-android/v6/benefithub#%EB%AF%B8%EC%85%98%ED%8C%A9), or follow a deep link to a specific screen in your app.

![](https://docs.buzzvil.com/api/content-image/buzzbenefit-android/v6/image/entrypoint-intro.png)

## Integration

Follow these steps to integrate EntryPoint.

### Step 1. Prepare

- Complete [Getting started](https://docs.buzzvil.com/en/docs/buzzbenefit-android/v6/getting-started).

### Step 2. Configure

> ✏️  **Note**\
> For native overlays, see [Use a native overlay](https://docs.buzzvil.com/en/docs/buzzbenefit-android/v6/native#%EB%84%A4%EC%9D%B4%ED%8B%B0%EB%B8%8C-%EC%98%A4%EB%B2%84%EB%A0%88%EC%9D%B4-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0).\
> To configure EntryPoint, contact your Buzzvil representative at <help@buzzvil.com>.

#### Entry point types

| Type          | Description                                                                                                                                   |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `FAB`         | A floating action button at the bottom right of the screen.                                                                                   |
| `Banner`      | A banner fixed at your chosen position on the screen. Multiple banner entries appear as slides and advance automatically every three seconds. |
| `Popup`       | A popup in the center of the screen.                                                                                                          |
| `BottomSheet` | A bottom sheet that slides up from the bottom of the screen.                                                                                  |
| `Custom`      | Lets you implement an entry point with a custom UI.                                                                                           |

#### Entry point images

| Type          | Image                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------- |
| `FAB`         | ![](https://docs.buzzvil.com/api/content-image/buzzbenefit-android/v6/image/entrypoint-FAB.png)         |
| `Banner`      | ![](https://docs.buzzvil.com/api/content-image/buzzbenefit-android/v6/image/entrypoint-banner.png)      |
| `Popup`       | ![](https://docs.buzzvil.com/api/content-image/buzzbenefit-android/v6/image/entrypoint-popup.png)       |
| `BottomSheet` | ![](https://docs.buzzvil.com/api/content-image/buzzbenefit-android/v6/image/entrypoint-bottomsheet.png) |

#### Supported entry point UI specifications

| Type          | Specifications                                                                                                                                                                                            |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `FAB`         | - Image formats: PNG, JPG, JSON (Lottie)
- File size: Up to 2 MB
- Image ratio: 60 x 60 (width x height)
- Tooltip: Up to 6 characters, including spaces
- Message: Up to 20 characters, including spaces |
| `Banner`      | * Image formats: PNG, JPG, JSON (Lottie)
* File size: Up to 2 MB
* Image ratio: 351 x 112 (width x height)                                                                                                |
| `Popup`       | - Image formats: PNG, JPG, JSON (Lottie)
- File size: Up to 2 MB
- Image ratio: 335 x 380 (width x height)                                                                                                |
| `BottomSheet` | * Image formats: PNG, JPG, JSON (Lottie)
* File size: Up to 2 MB
* Image ratio: 335 x 256 (width x height)                                                                                                |

### Step 3. Request

Request entry points as shown in the code below.

> ✏️  **Note**\
> Calling `load` retrieves all entry points enabled in the Dash admin at once.

```kotlin
BuzzEntryPoint.load(
    onSuccess = { availableTypes ->
        // 요청에 성공하면 표시 가능한 엔트리포인트 타입 배열과 함께 호출됩니다.
    }, onError = { buzzAdError ->
        // 요청에 실패하면 에러와 함께 호출됩니다.
    }
)
```

#### Entry point types in `BuzzEntryPointType`

| Type          | BuzzEntryPointType                |
| ------------- | --------------------------------- |
| `FAB`         | `BuzzEntryPointType.FAB`          |
| `Banner`      | `BuzzEntryPointType.BANNER`       |
| `Popup`       | `BuzzEntryPointType.POPUP`        |
| `BottomSheet` | `BuzzEntryPointType.BOTTOM_SHEET` |
| `Custom`      | `BuzzEntryPointType.CUSTOM`       |

### Step 4. Display (FAB)

Display the FAB entry point as shown below.

> ✏️  **Note**\
> You can call showFab after calling `BuzzEntryPoint.load` and receiving a successful onSuccess response.\
> Use canShow to check that the FAB can be displayed before calling it.

```kotlin
import com.buzzvil.entrypoint.BuzzEntryPoint

if (BuzzEntryPoint.canShow(BuzzEntryPointType.FAB)) {
    BuzzEntryPoint.showFab(binding.root)
}
```

### Step 4. Display (Banner)

Display the Banner entry point as shown below.

> ✏️  **Note**\
> You can call showBanner after calling `BuzzEntryPoint.load` and receiving a successful onSuccess response.\
> Use canShow to check that the Banner can be displayed before calling it.

```xml
<com.buzzvil.entrypoint.presentation.BuzzEntryPointBanner
    android:id="@+id/entryPointBanner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>


```

```kotlin
import com.buzzvil.entrypoint.BuzzEntryPoint

if (BuzzEntryPoint.canShow(BuzzEntryPointType.BANNER)) {
    BuzzEntryPoint.showBanner(entryPointBanner)
}

```

### Step 4. Display (Popup)

Display the Popup entry point as shown below.

> ✏️  **Note**\
> You can call showPopup after calling `BuzzEntryPoint.load` and receiving a successful onSuccess response.\
> Use canShow to check that the Popup can be displayed before calling it.

```kotlin
import com.buzzvil.entrypoint.BuzzEntryPoint

if (BuzzEntryPoint.canShow(BuzzEntryPointType.POPUP)) {
    BuzzEntryPoint.showPopup(requireContext())    
}

```

### Step 4. Display (BottomSheet)

Display the BottomSheet entry point as shown below.

> ✏️  **Note**\
> You can call showBottomSheet after calling `BuzzEntryPoint.load` and receiving a successful onSuccess response.\
> Use canShow to check that the BottomSheet can be displayed before calling it.

```kotlin
import com.buzzvil.entrypoint.BuzzEntryPoint

if (BuzzEntryPoint.canShow(BuzzEntryPointType.BOTTOM_SHEET)) {
    BuzzEntryPoint.showBottomSheet(requireContext())
}
```

### Step 4. Display (Custom)

Display a Custom entry point using the example below. You can design the UI freely and call `customEntryPointClicked` to handle clicks.

> ✏️  **Note**
>
> - Use your own internal identifier for the `identifier` value.
> - Send this `identifier` value to your Buzzvil representative.
> - `customEntryPointClicked` opens the desired page based on a recognized `identifier`. If it receives an unrecognized `identifier`, it performs the default action: opening BenefitHub.

```kotlin
val identifier = "YOUR_IDENTIFIER"
BuzzEntryPoint.customEntryPointClicked(requireContext(), identifier)
```

## Additional features

This section explains how to implement additional EntryPoint features.

### Customize deep-link behavior

> ✏️  **Note**\
> By default, clicking a deep link opens an external browser or app.\
> We recommend setting the deep-link handler with `setDeepLinkHandler` before calling `BuzzEntryPoint.load`.

You can customize deep-link behavior when an entry point is clicked. See the example below.

```kotlin
BuzzEntryPoint.setDeepLinkHandler { deepLinkUrl ->
    // 대시 어드민을 통해 설정한 deepLink url string이 전달됩니다.
    YourRouter.route(deepLinkUrl)
}
```
