# Getting started

Source: https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v6/getting-started
Platform: iOS
SDK major version: v6
Language: English (en)
Translation: AI-translated from Korean. Original: https://docs.buzzvil.com/docs/buzzbenefit-ios/v6/getting-started

Complete the setup below before using the Buzzvil iOS SDK (referred to below as the Buzzvil SDK).

## Requirements

- deployment target
  - **Minimum supported**: iOS 15.0 or later
- Xcode 26.0 or later

> ✏️  **Note**\
> If you need to support iOS 13 or iOS 14, use version 6.8.x. For details, see the [update guide](https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v6/migration#v6-%EB%82%B4-%EB%B2%84%EC%A0%84-%EC%97%85%EB%8D%B0%EC%9D%B4%ED%8A%B8).

> ✅  **Important**
>
> - These requirements apply to the latest version of the Buzzvil SDK.
> - Buzzvil recommends updating to the latest version for a stable ad platform, improved monetization features, and iOS compatibility.
> - You can use the SDK with cross-platform frameworks such as React Native and Flutter, but technical support for these integrations is not provided.



## Obtain integration IDs

To integrate the Buzzvil SDK, you need a unique identifier for your app (App ID) and for each ad placement (Unit ID). Contact your Buzzvil representative at <help@buzzvil.com> to obtain them.

![](https://docs.buzzvil.com/api/content-image/buzzbenefit-ios/v6/image/02-getting-started/00-app_unit_id.png)

| ID type | Description                                                                     |
| ------- | ------------------------------------------------------------------------------- |
| App ID  | A unique identifier assigned to each app that integrates the Buzzvil SDK.       |
| Unit ID | A unique identifier assigned to each placement created through the Buzzvil SDK. |

## Integrate a reward server

Ads supplied by Buzzvil are classified as rewarded ads, which award points to users, and non-rewarded ads, which do not.

- Non-rewarded ads: You do not need to award points when users engage with these ads, so a point-processing server is not required.
- Rewarded ads: You must award points when users engage with these ads, so you need a server that can process reward requests from the client.

If you have your own server that can process reward requests for rewarded ads, integrate it by following the [postback integration guide](https://buzzvil.atlassian.net/wiki/spaces/BDG/pages/1756004654/API).

![](https://docs.buzzvil.com/api/content-image/buzzbenefit-ios/v6/image/02-getting-started/01-postback.png)

## Install the SDK

### Swift Package Manager

Follow these steps to install the Buzzvil SDK using Swift Package Manager.

> ✏️  **Note**\
> If you are migrating from a CocoaPods-based project, run pod deintegrate to remove CocoaPods from your Xcode project. You can safely delete the .xcworkspace file generated by CocoaPods afterward.

1. In Xcode, go to `File > Add Package Dependencies`.

2. Search for the Buzzvil SDK Swift Package GitHub repository.

```
https://github.com/Buzzvil/buzzvil-ios-sdk
```

3. Select a version. We recommend Up to Next Minor Version.

4. Select `BuzzvilSDK` from the package products.

> ✏️  **Note**\
> If you do not use BuzzBanner, you can select `BuzzvilSDK-WithoutThirdParty`. This limits BuzzBanner and interstitial ad features within BenefitHub.

For details about adding package dependencies, see the [official Apple Developer documentation](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).

### Cocoapods

> ❗️ **Caution**\
> CocoaPods distribution of the Buzzvil SDK ends with 6.10.x. Because the CocoaPods repository (trunk) becomes read-only on December 2, 2026, versions released after that are provided only through Swift Package Manager. Use Swift Package Manager for new integrations. For details, see [End of CocoaPods distribution](https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v6/migration#cocoapods-%EB%B0%B0%ED%8F%AC-%EC%A2%85%EB%A3%8C).

To install the Buzzvil SDK using CocoaPods, add BuzzvilSDK to your `Podfile`.

> ✏️  **Note**\
> The code snippet below uses the last version available through CocoaPods (6.10.x).

```
   pod 'BuzzvilSDK', '~> 6.10'
```

> ✏️ **Note**\
> For offline builds, request the required frameworks from your Buzzvil representative at <help@buzzvil.com>. See [Offline builds](https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v5/faq#%EC%98%A4%ED%94%84%EB%9D%BC%EC%9D%B8-%EB%B9%8C%EB%93%9C) for details.

> ❌  **Error**\
> If you encounter problems installing the SDK, see [Troubleshooting](https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v6/troubleshooting).

## Initialize the SDK

After installing the Buzzvil SDK, initialize it with the required information, including your App ID and user profile.

### Initialize the Buzzvil SDK

1. Call `BuzzBenefit.shared.initialize()` at your chosen location to initialize the SDK.

> 🚨 **Warning**\
> Other functions do not work correctly if called before `BuzzBenefit.shared.initialize()`. Always call the initialization function before any other function.

**Swift**

```swift
import BuzzvilSDK

let config = BuzzBenefitConfig.Builder(appId: "YOUR_APP_ID")
    .build()
BuzzBenefit.shared.initialize(with: config)
```

**Objective C**

```objectivec
@import BuzzvilSDK;

BuzzBenefitConfig *config = [BuzzBenefitConfig configWith:^(BuzzBenefitConfigBuilder * _Nonnull builder) {
  builder.appId = @"YOUR_APP_ID";
}];
[[BuzzBenefit sharedInstance] initializeWith:config];
```

### Log in

You must log in before requesting an ad allocation. See the table below for the fields in a login request.

❗️❗️❗️  **Important**  ❗️❗️❗️\
Although **gender** and **year of birth** are marked as recommended, targeted ads cannot be served without them. Most Buzzvil ads are targeted, so **_you must provide this information for normal ad allocation_**.

| Required/recommended | User profile | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Required             | `userId`     | A unique ID for each user that does not identify them personally (login IDs and email addresses are not allowed). This value must remain unchanged while the user uses your service and is required for ad allocation. Limited to 255 ASCII characters or fewer. ⚠️  **Caution** If the user ID changes after the app is uninstalled and reinstalled, or you cannot use a fixed ID for another reason, **_action-based ads cannot be served because of the risk of abuse_**. Contact your Buzzvil business representative if a user's unique identifier can change. |
| Recommended          | `gender`     | The user's gender. Male: `BuzzBenefitUserGender.male`, Female: `BuzzBenefitUserGender.female`                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Recommended          | `birthYear`  | The user's year of birth.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

The following example registers a user profile with the SDK. You can also delete a registered user profile.

**Swift**

```swift
// 로그인을 요청하는 코드입니다.
let buzzBenefitUser = BuzzBenefitUser.Builder(userId: "USER_ID")
  .setGender(.male)
  .setBirthYear(YYYY)
  .build()

BuzzBenefit.shared.login(
  with: buzzBenefitUser,
  onSuccess: {
    // 로그인이 성공한 경우 호출됩니다.
  },
  onFailure: { error in
    // 로그인이 실패한 경우 호출됩니다.
  }
)

// 로그인 상태를 확인하는 코드입니다.
BuzzBenefit.shared.isLoggedIn()

// 로그아웃하는 코드입니다.
BuzzBenefit.shared.logout()
```

**Objective C**

```objectivec
BuzzBenefitUser *buzzBenefitUser = [BuzzBenefitUser userWith:^(BuzzBenefitUserBuilder * _Nonnull builder) {
  builder.userId = @"USER_ID";
  builder.gender = BuzzBenefitUserGenderMale;
  builder.birthYear = YYYY;
}];

[[BuzzBenefit sharedInstance] loginWith:buzzBenefitUser onSuccess:^{
  // 로그인이 성공한 경우 호출됩니다.
} onFailure:^(NSError * _Nonnull error) {
  // 로그인이 실패한 경우 호출됩니다.
}];

// 로그인 상태를 확인하는 코드입니다.
[[BuzzBenefit sharedInstance] isLoggedIn];

// 로그아웃하는 코드입니다.
[[BuzzBenefit sharedInstance] logout];
```

## Sample code

See the [GitHub sample code](https://github.com/Buzzvil/buzz-sdk-samples/tree/master/buzzvil-sdk-v6-ios) for examples of actual implementations.

## Frequently asked questions

| Question                                   | Answer                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| What changed to support iOS 17?            | See [Support for iOS 17](https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v6/faq#ios-17%EC%9D%84-%EC%9C%84%ED%95%9C-%EB%8C%80%EC%9D%91).                                                                                                                                                                                                                               |
| What is the ATT permission guidance modal? | See [ATT (App Tracking Transparency) permission guidance modal](https://docs.buzzvil.com/en/docs/buzzbenefit-ios/v6/benefithub#attapp-tracking-transparency-%EC%95%B1-%EC%B6%94%EC%A0%81-%ED%88%AC%EB%AA%85%EC%84%B1-%ED%97%88%EC%9A%A9-%EC%9C%A0%EB%8F%84-%EB%AA%A8%EB%8B%AC) for the modal that guides users who have not allowed tracking to the relevant settings. |
