Skip to content

feat:add flexad sample#271

Open
edenryu wants to merge 1 commit into
masterfrom
buzzvilsdk-6.7.x
Open

feat:add flexad sample#271
edenryu wants to merge 1 commit into
masterfrom
buzzvilsdk-6.7.x

Conversation

@edenryu
Copy link
Copy Markdown

@edenryu edenryu commented Apr 29, 2026

add flexad sample


Summary by cubic

Adds FlexAd sample screens for Android and iOS to demonstrate loading and rendering with BuzzFlex. Also updates SDKs to the 6.7.x line.

  • New Features

    • Android: Added YourFlexAdActivity using BuzzFlex + BuzzFlexAdView; added YOUR_FLEX_AD_ID, manifest entry, and a "FlexAd" button in MainActivity.
    • iOS: Added FlexAdViewController using BuzzFlex + BuzzFlexAdView; added a "FlexAd" button in ViewController.
  • Dependencies

    • Android: Updated com.buzzvil:buzzvil-bom to 6.7.2.
    • iOS: Updated BuzzvilSDK CocoaPod to 6.7.1.

Written for commit 8735983. Summary will update on new commits. Review in cubic

@edenryu edenryu requested review from chattymin and ssmmkk00 April 29, 2026 02:07
@edenryu edenryu self-assigned this Apr 29, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Walkthrough

이 변경은 Buzzvil SDK의 Flex Ad 기능을 Android 및 iOS 샘플 애플리케이션에 추가합니다. Android 측에서는 Buzzvil BOM을 6.4.5에서 6.7.2로 업그레이드하고, 새로운 YourFlexAdActivity를 구현하여 BuzzFlexAdView를 초기화하고 BuzzFlex 인스턴스를 로드합니다. 관련 상수, 매니페스트 항목, 레이아웃 파일도 추가됩니다. iOS 측에서는 BuzzvilSDK를 6.4.3에서 6.7.1로 업그레이드하고, 새로운 FlexAdViewController를 생성하여 Flex 광고 표시 기능을 구현합니다. 두 플랫폼 모두 메인 화면에 네비게이션 버튼을 추가합니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat:add flexad sample' clearly and concisely describes the main change: adding FlexAd sample screens for both Android and iOS platforms.
Description check ✅ Passed The description is directly related to the changeset, detailing the addition of FlexAd sample screens and SDK version updates, with clear explanations of what was added to both platforms.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch buzzvilsdk-6.7.x

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/FlexAd/FlexAdViewController.swift (1)

39-43: delegate 콜백에서 UIKit 업데이트 시 메인 스레드 보장을 명시하세요.

Line 42의 flexAdView.bind(buzzFlex)는 UIView 바인딩으로 UIKit 업데이트입니다. 공식 문서에서 BuzzFlexDelegate 콜백의 스레드 보장이 명시되지 않으며, 동일한 SDK의 다른 delegate 콜백들(예: InterstitialController의 buzzInterstitialDidLoad, buzzInterstitialDidFail)은 메인 큐 보장을 위해 DispatchQueue.main.async로 감싸져 있습니다. 일관성 있는 방어적 프로그래밍을 위해 메인 큐 dispatch를 추가하는 것이 권장됩니다.

제안 수정안
     func buzzFlexOnSuccess() {
         // 광고 로드 성공 시 호출됩니다.
         // BuzzFlexAdView에 광고를 표시합니다.
-        flexAdView.bind(buzzFlex)
+        DispatchQueue.main.async { [weak self] in
+            guard let self else { return }
+            self.flexAdView.bind(self.buzzFlex)
+        }
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/FlexAd/FlexAdViewController.swift`
around lines 39 - 43, The buzzFlexOnSuccess delegate method performs a UIKit
update via flexAdView.bind(buzzFlex) but does not guarantee execution on the
main thread; wrap the UIKit call inside DispatchQueue.main.async to ensure
main-queue execution (update the buzzFlexOnSuccess implementation so that
flexAdView.bind(buzzFlex) is dispatched to the main queue, matching the pattern
used by other callbacks like buzzInterstitialDidLoad/buzzInterstitialDidFail).
buzzvil-sdk-v6-android/app/src/main/res/layout/activity_main.xml (1)

234-242: 신규 UI 텍스트는 문자열 리소스로 분리하는 것을 권장합니다.

현재 하드코딩된 "FlexAd"는 다국어/문구 변경 대응 비용을 키웁니다.

♻️ 제안 수정안
-                android:text="FlexAd"
+                android:text="@string/flexad_title"
...
-                android:text="FlexAd" />
+                android:text="@string/flexad_button" />
<!-- res/values/strings.xml (신규 항목 예시) -->
<string name="flexad_title">FlexAd</string>
<string name="flexad_button">FlexAd</string>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@buzzvil-sdk-v6-android/app/src/main/res/layout/activity_main.xml` around
lines 234 - 242, The hardcoded "FlexAd" text should be moved to string resources
and referenced from the layout: add entries like flexad_title and flexad_button
to res/values/strings.xml, then replace the android:text attributes on the
TextView and the Button (the Button with id "flexAdButton") to reference
`@string/flexad_title` and `@string/flexad_button` respectively so UI text is
localized and maintainable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@buzzvil-sdk-v6-android/app/src/main/java/com/buzzvil/sample/buzzvil_sdk_v6_sample/flexad/YourFlexAdActivity.kt`:
- Around line 32-34: The onFailure(adError: BuzzAdError) callback in
YourFlexAdActivity is currently empty; add minimal error handling by logging the
failure and showing user feedback: call Log.e with a clear message and the
adError (e.g., Log.e("YourFlexAdActivity", "FlexAd load failed", adError)) and
optionally show a Toast or update UI to indicate the ad failed to load; place
these changes inside the onFailure method to aid debugging and user awareness.

In `@buzzvil-sdk-v6-android/app/src/main/res/layout/activity_main.xml`:
- Around line 229-235: The TextView uses android:textSize="24dp" which prevents
respecting user font-scale accessibility settings; update the android:textSize
attribute in that TextView to use "sp" (e.g., 24sp) instead of "dp" so the
system scales text with user font preferences.

In `@buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/FlexAd/FlexAdViewController.swift`:
- Around line 25-29: The current NSLayoutConstraint.activate block for
flexAdView only pins top/leading/trailing and can allow the view to intrude into
the bottom safe area; add a bottom constraint to the safe area (e.g., add
flexAdView.bottomAnchor.constraint(lessThanOrEqualTo:
view.safeAreaLayoutGuide.bottomAnchor, constant: -16) or equality if you want a
fixed inset) so flexAdView respects view.safeAreaLayoutGuide.bottomAnchor and
prevents clipping; update the NSLayoutConstraint.activate array that configures
flexAdView to include this bottom constraint.

---

Nitpick comments:
In `@buzzvil-sdk-v6-android/app/src/main/res/layout/activity_main.xml`:
- Around line 234-242: The hardcoded "FlexAd" text should be moved to string
resources and referenced from the layout: add entries like flexad_title and
flexad_button to res/values/strings.xml, then replace the android:text
attributes on the TextView and the Button (the Button with id "flexAdButton") to
reference `@string/flexad_title` and `@string/flexad_button` respectively so UI text
is localized and maintainable.

In `@buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/FlexAd/FlexAdViewController.swift`:
- Around line 39-43: The buzzFlexOnSuccess delegate method performs a UIKit
update via flexAdView.bind(buzzFlex) but does not guarantee execution on the
main thread; wrap the UIKit call inside DispatchQueue.main.async to ensure
main-queue execution (update the buzzFlexOnSuccess implementation so that
flexAdView.bind(buzzFlex) is dispatched to the main queue, matching the pattern
used by other callbacks like buzzInterstitialDidLoad/buzzInterstitialDidFail).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb543e3e-8eca-435b-8aeb-5a25fcd62d0d

📥 Commits

Reviewing files that changed from the base of the PR and between b7a6b56 and 8735983.

📒 Files selected for processing (10)
  • buzzvil-sdk-v6-android/app/build.gradle.kts
  • buzzvil-sdk-v6-android/app/src/main/AndroidManifest.xml
  • buzzvil-sdk-v6-android/app/src/main/java/com/buzzvil/sample/buzzvil_sdk_v6_sample/Constant.kt
  • buzzvil-sdk-v6-android/app/src/main/java/com/buzzvil/sample/buzzvil_sdk_v6_sample/MainActivity.kt
  • buzzvil-sdk-v6-android/app/src/main/java/com/buzzvil/sample/buzzvil_sdk_v6_sample/flexad/YourFlexAdActivity.kt
  • buzzvil-sdk-v6-android/app/src/main/res/layout/activity_main.xml
  • buzzvil-sdk-v6-android/app/src/main/res/layout/activity_your_flex_ad.xml
  • buzzvil-sdk-v6-ios/Podfile
  • buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/FlexAd/FlexAdViewController.swift
  • buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/ViewController.swift

Comment on lines +32 to +34
override fun onFailure(adError: BuzzAdError) {
// 광고 로드 실패 시 호출됩니다.
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

실패 콜백이 비어 있어 문제 원인 추적이 어렵습니다.

Line 32-34에서 최소한 로그/사용자 피드백을 남기는 편이 샘플 품질에 유리합니다.

🔧 제안 수정안
+import android.util.Log
+import android.widget.Toast
...
             override fun onFailure(adError: BuzzAdError) {
                 // 광고 로드 실패 시 호출됩니다.
+                Log.e("YourFlexAdActivity", "FlexAd load failed: $adError")
+                Toast.makeText(
+                    this@YourFlexAdActivity,
+                    "FlexAd load failed: ${adError.type}",
+                    Toast.LENGTH_SHORT
+                ).show()
             }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
override fun onFailure(adError: BuzzAdError) {
// 광고 로드 실패 시 호출됩니다.
}
override fun onFailure(adError: BuzzAdError) {
// 광고 로드 실패 시 호출됩니다.
Log.e("YourFlexAdActivity", "FlexAd load failed: $adError")
Toast.makeText(
this@YourFlexAdActivity,
"FlexAd load failed: ${adError.type}",
Toast.LENGTH_SHORT
).show()
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@buzzvil-sdk-v6-android/app/src/main/java/com/buzzvil/sample/buzzvil_sdk_v6_sample/flexad/YourFlexAdActivity.kt`
around lines 32 - 34, The onFailure(adError: BuzzAdError) callback in
YourFlexAdActivity is currently empty; add minimal error handling by logging the
failure and showing user feedback: call Log.e with a clear message and the
adError (e.g., Log.e("YourFlexAdActivity", "FlexAd load failed", adError)) and
optionally show a Toast or update UI to indicate the ad failed to load; place
these changes inside the onFailure method to aid debugging and user awareness.

Comment on lines +229 to +235
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:text="FlexAd"
android:textSize="24dp" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

textSizedp를 쓰면 접근성 글꼴 확대가 적용되지 않습니다.

Line 235는 sp 단위를 사용해야 사용자 폰트 스케일 설정을 반영할 수 있습니다.

🔧 제안 수정안
-                android:textSize="24dp" />
+                android:textSize="24sp" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:text="FlexAd"
android:textSize="24dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:text="FlexAd"
android:textSize="24sp" />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@buzzvil-sdk-v6-android/app/src/main/res/layout/activity_main.xml` around
lines 229 - 235, The TextView uses android:textSize="24dp" which prevents
respecting user font-scale accessibility settings; update the android:textSize
attribute in that TextView to use "sp" (e.g., 24sp) instead of "dp" so the
system scales text with user font preferences.

Comment on lines +25 to +29
NSLayoutConstraint.activate([
flexAdView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16),
flexAdView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
flexAdView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

하단 안전영역 경계 제약이 없어 화면 침범 가능성이 있습니다.

Line 25-29은 상단/좌우만 제약하고 있어, 콘텐츠 높이가 커질 때 safe area 하단 침범/클리핑이 생길 수 있습니다.

제안 수정안
     NSLayoutConstraint.activate([
         flexAdView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16),
         flexAdView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
         flexAdView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
+        flexAdView.bottomAnchor.constraint(lessThanOrEqualTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16),
     ])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/FlexAd/FlexAdViewController.swift`
around lines 25 - 29, The current NSLayoutConstraint.activate block for
flexAdView only pins top/leading/trailing and can allow the view to intrude into
the bottom safe area; add a bottom constraint to the safe area (e.g., add
flexAdView.bottomAnchor.constraint(lessThanOrEqualTo:
view.safeAreaLayoutGuide.bottomAnchor, constant: -16) or equality if you want a
fixed inset) so flexAdView respects view.safeAreaLayoutGuide.bottomAnchor and
prevents clipping; update the NSLayoutConstraint.activate array that configures
flexAdView to include this bottom constraint.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Copy link
Copy Markdown
Contributor

@ssmmkk00 ssmmkk00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@chattymin chattymin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants