Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buzzvil-sdk-v6-android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ android {

dependencies {
// buzzvil-sdk
val buzzvilBomVersion = "6.4.5"
val buzzvilBomVersion = "6.7.2"

api(platform("com.buzzvil:buzzvil-bom:$buzzvilBomVersion"))
implementation("com.buzzvil:buzzvil-sdk")
Expand Down
3 changes: 3 additions & 0 deletions buzzvil-sdk-v6-android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<activity
android:name=".banner.YourBannerActivity"
android:exported="false" />
<activity
android:name=".flexad.YourFlexAdActivity"
android:exported="false" />

<service
android:name=".pop.YourBuzzPopControlService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ object Constant {
const val YOUR_NATIVE_ID = "YOUR_NATIVE_ID"
const val YOUR_INTERSTITIAL_ID = "YOUR_INTERSTITIAL_ID"
const val YOUR_BANNER_ID = "YOUR_BANNER_ID"
const val YOUR_FLEX_AD_ID = "YOUR_FLEX_AD_ID"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.buzzvil.buzzbenefit.pop.BuzzPop
import com.buzzvil.buzzbenefit.pop.BuzzPopActivateListener
import com.buzzvil.sample.buzzvil_sdk_v6_sample.Constant.YOUR_USER_ID
import com.buzzvil.sample.buzzvil_sdk_v6_sample.banner.YourBannerActivity
import com.buzzvil.sample.buzzvil_sdk_v6_sample.flexad.YourFlexAdActivity
import com.buzzvil.sample.buzzvil_sdk_v6_sample.buzzbenefithub.YourBenefitHubActivity
import com.buzzvil.sample.buzzvil_sdk_v6_sample.buzzentrypoint.BuzzEntryPointActivity
import com.buzzvil.sample.buzzvil_sdk_v6_sample.buzznative.YourNativeCarouselActivity
Expand Down Expand Up @@ -214,6 +215,11 @@ class MainActivity : AppCompatActivity() {
navigateActivity(YourBannerActivity::class.java)
}

// FlexAd
binding.flexAdButton.setOnClickListener {
navigateActivity(YourFlexAdActivity::class.java)
}


// lifecycleScope.launch(Dispatchers.IO) {
// // SDK 초기화를 하지 않으면 privacyPolicyManager는 null을 반환합니다.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.buzzvil.sample.buzzvil_sdk_v6_sample.flexad

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.buzzvil.buzzbenefit.BuzzAdError
import com.buzzvil.buzzbenefit.flexad.BuzzFlex
import com.buzzvil.buzzbenefit.flexad.BuzzFlexAdView
import com.buzzvil.sample.buzzvil_sdk_v6_sample.Constant
import com.buzzvil.sample.buzzvil_sdk_v6_sample.databinding.ActivityYourFlexAdBinding

class YourFlexAdActivity : AppCompatActivity() {

private lateinit var binding: ActivityYourFlexAdBinding
private lateinit var buzzFlex: BuzzFlex

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityYourFlexAdBinding.inflate(layoutInflater)
setContentView(binding.root)

val buzzFlexAdView = BuzzFlexAdView(this)
binding.buzzFlexAdContainer.addView(buzzFlexAdView)

buzzFlex = BuzzFlex(Constant.YOUR_FLEX_AD_ID)
buzzFlex.setListener(object : BuzzFlex.Listener {
override fun onSuccess() {
// 광고 로드 성공 시 호출됩니다.
// BuzzFlexAdView에 광고를 표시합니다.
buzzFlexAdView.bind(buzzFlex)
}

override fun onFailure(adError: BuzzAdError) {
// 광고 로드 실패 시 호출됩니다.
}
Comment on lines +32 to +34
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.


override fun onClicked() {
// 광고 클릭 시 호출됩니다.
}
})

buzzFlex.load()
}

override fun onDestroy() {
super.onDestroy()
buzzFlex.dispose()
}
}
15 changes: 15 additions & 0 deletions buzzvil-sdk-v6-android/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,21 @@
android:layout_marginHorizontal="16dp"
android:text="BuzzBanner" />

<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" />
Comment on lines +229 to +235
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.


<Button
android:id="@+id/flexAdButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:text="FlexAd" />

</LinearLayout>
</ScrollView>
</FrameLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">

<FrameLayout
android:id="@+id/buzzFlexAdContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>
10 changes: 5 additions & 5 deletions buzzvil-sdk-v6-ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ platform :ios, deployment_target
target 'buzzvil-sdk-ios-objc' do
use_frameworks!

pod 'BuzzvilSDK', '= 6.4.3'
pod 'BuzzvilSDK', '= 6.7.1'
end

target 'buzzvil-sdk-ios-swift' do
use_frameworks!
pod 'BuzzvilSDK', '= 6.4.3'

pod 'BuzzvilSDK', '= 6.7.1'
end

target 'buzzvil-sdk-ios-swiftui' do
use_frameworks!
pod 'BuzzvilSDK', '= 6.4.3'

pod 'BuzzvilSDK', '= 6.7.1'
end

post_install do |installer|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import UIKit
import BuzzvilSDK

class FlexAdViewController: UIViewController {

private let buzzFlex = BuzzFlex(unitId: "YOUR_FLEX_AD_UNIT_ID")

private lazy var flexAdView: BuzzFlexAdView = {
let view = BuzzFlexAdView()
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
navigationItem.title = "FlexAd"

setupLayout()
loadAd()
}

private func setupLayout() {
view.addSubview(flexAdView)
NSLayoutConstraint.activate([
flexAdView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16),
flexAdView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
flexAdView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
])
Comment on lines +25 to +29
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.

}

private func loadAd() {
buzzFlex.delegate = self
buzzFlex.load()
}
}

extension FlexAdViewController: BuzzFlexDelegate {
func buzzFlexOnSuccess() {
// 광고 로드 성공 시 호출됩니다.
// BuzzFlexAdView에 광고를 표시합니다.
flexAdView.bind(buzzFlex)
}

func buzzFlexOnFailure(_ error: Error) {
// 광고 로드 실패 시 호출됩니다.
}

func buzzFlexOnClicked() {
// 광고 클릭 시 호출됩니다.
}
}
14 changes: 14 additions & 0 deletions buzzvil-sdk-v6-ios/buzzvil-sdk-ios-swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ class ViewController: UIViewController {
button.addTarget(self, action: #selector(pushEntryPointViewController), for: .touchUpInside)
return button
}()

private lazy var flexAdButton: UIButton = {
let button = UIButton(frame: .zero)
button.setTitle("FlexAd", for: .normal)
button.addTarget(self, action: #selector(pushFlexAdViewController), for: .touchUpInside)
return button
}()

private lazy var inquiryButton: UIButton = {
let button = UIButton(frame: .zero)
Expand Down Expand Up @@ -117,6 +124,7 @@ class ViewController: UIViewController {
rootStackView.addArrangedSubview(benefitHubCustomNaviContainerButton)
rootStackView.addArrangedSubview(bannerButton)
rootStackView.addArrangedSubview(entryPointButton)
rootStackView.addArrangedSubview(flexAdButton)
rootStackView.addArrangedSubview(inquiryButton)
rootStackView.addArrangedSubview(privacyConsentStatusLabel)
rootStackView.addArrangedSubview(loadPrivacyConsentStatusButton)
Expand All @@ -133,6 +141,7 @@ class ViewController: UIViewController {
benefitHubCustomNaviContainerButton,
bannerButton,
entryPointButton,
flexAdButton,
inquiryButton,
loadPrivacyConsentStatusButton,
grantPrivacyConsentButton,
Expand Down Expand Up @@ -203,6 +212,11 @@ class ViewController: UIViewController {
let entryPointViewController = EntryPointViewController()
navigationController?.pushViewController(entryPointViewController, animated: true)
}

@objc private func pushFlexAdViewController() {
let flexAdViewController = FlexAdViewController()
navigationController?.pushViewController(flexAdViewController, animated: true)
}

@objc private func showInquiry() {
BuzzAdBenefit.shared.openInquiryPage()
Expand Down