StageUp
모바일 SDK프로모션

Unity

AdStage Unity SDK를 통해 사용자 맞춤형 프로모션을 조회하고, UI로 표시할 수 있습니다.

1. 프로모션 리스트 조회: getAdStagePromotionList

모든 파라미터를 포함한 조회 예시입니다. 필요 항목만 전달해도 됩니다.

// 모든 파라미터를 포함한 PromotionList 호출 예시
NBaseSDK.NBase.getAdStagePromotionList(
	bannerType: "popup",                 // 배너 타입: popup, banner, interstitial
	targetAudience: "new_users",         // 타겟 오디언스
	deviceType: "mobile",                // 디바이스 타입: mobile, tablet, desktop
	region: "KR",                        // 지역 코드
	limit: 10,                            // 조회 개수 제한
	status: "active",                    // 상태: active, inactive
	partner: "google",                   // 파트너 ID
	primaryInterest: "rpg",              // 주요 관심사
	primaryAgeGroup: "20-30",            // 주요 연령대
	gameGenrePreference: "action",       // 게임 장르 선호도
	playerSpendingTier: "high",          // 지출 등급
	playTimePattern: "evening",          // 플레이 시간대
	completionHandler: (promotionList, error) =>
	{
		if (error != null)
		{
			Debug.LogError($"Failed to get promotion list: {error.message}");
			return;
		}
 
		Debug.Log($"Total promotions: {promotionList.totalItems}");
 
		foreach (var promotion in promotionList.items)
		{
			Debug.Log($"Promotion ID: {promotion.id}");
			Debug.Log($"Title: {promotion.title}");
			Debug.Log($"Description: {promotion.description}");
			Debug.Log($"Banner URL: {promotion.bannerUrl}");
		}
	}
);

2. 프로모션 열기: openAdStagePromotion

조건에 맞는 프로모션을 즉시 열어 사용자에게 표시합니다.

// Promotion 열기 예시
NBaseSDK.NBase.openAdStagePromotion(
	promotionId: "promo_12345",          // 특정 프로모션 ID(선택)
	bannerType: "popup",                 // 배너 타입
	targetAudience: "returning_users",   // 타겟 오디언스
	deviceType: "mobile",                // 디바이스 타입
	region: "KR",                        // 지역 코드
	partner: "facebook",                 // 파트너 ID
	primaryInterest: "strategy",         // 주요 관심사
	primaryAgeGroup: "25-35",            // 주요 연령대
	gameGenrePreference: "strategy",     // 게임 장르 선호도
	playerSpendingTier: "medium",        // 지출 등급
	playTimePattern: "weekend",          // 플레이 시간대
	showTodayButton: true,                // "오늘 하루 보지 않기" 버튼 표시
	completionHandler: (success, error) =>
	{
		if (error != null)
		{
			Debug.LogError($"Failed to open promotion: {error.message}");
			return;
		}
 
		if (success)
		{
			Debug.Log("Promotion opened successfully");
		}
		else
		{
			Debug.Log("No matching promotion found");
		}
	}
);

3. 참고 사항

  • 모든 파라미터는 선택이며, null/생략 시 기본 전체 조건으로 조회됩니다.
  • getAdStagePromotionList는 데이터 조회 전용, openAdStagePromotion은 UI 렌더링 포함입니다.
  • 초기화 코드는 앱 시작 시점에 수행하고, 라이프사이클 콜백 위치를 정확히 반영하세요.

목차