Skip to content

0.8.0

Choose a tag to compare

@smuravev smuravev released this 16 Nov 14:49
· 26 commits to main since this release
a2594a6
  • Renaming creativeUrl -> bannerUrl in the SDK init options.

  • Renaming productCreativeUrl -> productUrl in the SDK init options.

TechAdvertising.init(
  storeUrl = "https://play.google.com/store/apps/details?id=com.myapp",
  sessionId = "YOUR_SESSION_ID",
  debugMode = true,
  headers = mapOf("Authorization" to {
    "Bearer CUSTOM_AUTH_TOKEN"
  }),
  initConfig = InitConfig(
    core = CoreDestination(
      bannerUrl = "https://YOUR_BANNER_CREATIVE_ENDPOINT",
      productUrl = "https://YOUR_PRODUCT_CREATIVE_ENDPOINT"
    ),
  ),
  remoteConfigUrl = "https://my.configuration.server.com"
)
  • Removed OpenRTB protocol from Standard SDK distribution.

  • Common Banner Creative: We combined HTMLBannerView / HTMLBannerCreative, ImageBannerView / ImageBannerCreative, MediaView / MediaCreative to one common CreativeView / Creative solution. Now, SDK constructs UI layout based on type of creative which retrieved from backend. Host developer no need to manage different creatives manually in the code. SDK supports the following creative types automatically (transparently for host developer):

    • HTML Banner (html specific ad) - SDK injects HTML page into CreativeView.
      Underhood, there is embedded android.webkit.WebView (embedded browser engine) where HTML banner
      page loaded and rendered in.
    • (Experimental) Image Banner (image specific ad) - this kind of banner uses simple image underhood. No embedded browser
      engine at all.
    • Media Banner (video, audio) - as a content CreativeView uses Ads media content
      based on VAST specification.
    • Here is an example how to use common Banner Creative API now:
val creativeView = CreativeView(this)
        
// Optionally, you can enable or disable adaptive UI using the following property.
// This option fits banner content to aspect ratio of your `CreativeView` frame.
// 'true' is used by default.
creativeView.scaleToFit = true
        
// Optionally, you can enable or disable vertical and horizontal scrolling of HTML content 
// inside of `CreativeView` frame.
// Eg: if you use complex HTML content as a banner creative, but your app UI doesn't provide enough 
// frame size to show whole HTML content. So, you can enable this option to give capability to 
// your users to scroll the HTML content to see it.
// 'false' is used by default.
creativeView.isScrollEnabled = false

. . .

creativeView.query = CreativeQuery(
  placementId = "YOUR_PLACEMENT_ID",
  sizes = listOf(Size(width = 260, height = 106)),
  floorPrice = 2.0,
  currency = "RUB",
  customParams = mapOf(
      "skuId" to "LG00001",
      "skuName" to "Leggo bricks (speed boat)",
      "category" to "Kids",
      "subСategory" to "Lego",
      "gdprConsent" to "CPsmEWIPsmEWIABAMBFRACBsABEAAAAgEIYgACJAAYiAAA.QRXwAgAAgivA",
      "ccpa" to "1YNN",
      "coppa" to "1",
  ),
)

. . .

val creative = Creative(
    lifecycle = lifecycle,
    creativeView = creativeView,
    listener = object : CreativeEventListener {
        override fun onLoadDataSuccess(creativeView: CreativeView) {
            // Handle success (banner request executed successfully)
        }

        override fun onLoadDataFail(creativeView: CreativeView, throwable: Throwable?) {
            // Handle an error while banner request in progress
        }

        override fun onLoadContentSuccess(creativeView: CreativeView) {
            // Handle success (banner content loaded successfully)
        }

        override fun onLoadContentFail(creativeView: CreativeView, throwable: Throwable?) {
            // Handle an error while banner content loaded 
        }

        override fun onNoAdContent(creativeView: CreativeView) {
            // Server returns 204-NoContent response
        }

        override fun onClose(creativeView: CreativeView) {
            // Banner has been closed (eg: user pressed the close button of the banner)
        }
    }
)

creative.load()

NOTICE: See detailed info in the official doc: https://docs.ad4tech.net/sdk-ads-android.html