Skip to content

Repository files navigation

Zesty Ads SDK for visionOS

Swift Version Platform

The Zesty Ads SDK for visionOS enables developers to seamlessly integrate native advertising into their visionOS applications. Connect your app to the Zesty Network and start monetizing with high-quality, contextually relevant advertisements.

Features

  • 🎯 Native visionOS Integration - Built specifically for Apple's spatial computing platform
  • 🖼️ Multiple Ad Formats - Support for banners, billboards, interstitials, and video ads
  • 📱 Responsive Design - Automatic scaling and aspect ratio preservation
  • 🔄 Fallback Handling - Default ads when network requests fail
  • 📊 Analytics Integration - Built-in click and impression tracking
  • 🚀 Easy Setup - Simple SwiftUI component integration

Supported Ad Formats

Format Dimensions Use Case
Medium Rectangle 300×250 Standard banner ads
Billboard 970×250 Large horizontal banners
Mobile Interstitial 640×1136 Full-screen ads
Video 1920×1080 Video advertisements

Installation

Swift Package Manager

Add the Zesty Ads SDK to your Xcode project:

  1. Open your project in Xcode
  2. Go to FileAdd Package Dependencies
  3. Enter the repository URL: https://github.com/zestyxyz/zesty-ads-sdk-visionos.git
  4. Click Add Package
  5. Select your target and add the ZestyAdsSDK library

Manual Installation

  1. Add this repository as a package dependency via URL
  2. Under TargetsYOUR_TARGETBuild PhasesLink Binary With Libraries, add this package

Quick Start

You can see more comprehensive documentation here.

Basic Implementation

import SwiftUI
import RealityKit
import RealityKitContent
import ZestyAdsSDK

struct ContentView: View {

    var body: some View {
        VStack {
            ZestyBannerView(adUnitId: "<YOUR_AD_UNIT_ID_HERE>", format: Formats.Billboard)
        }
        .padding()
    }
}

Configuration

Getting Your Ad Unit ID

  1. Sign up for a Zesty Network account at zesty.market
  2. Create an ad space for your visionOS app
  3. Copy your Ad Unit ID (must be a valid UUID format)

Important Notes

  • Ad Unit ID Validation: Your Ad Unit ID must be a valid UUID format. Invalid UUIDs will show default ads only.
  • Network Connectivity: The SDK gracefully handles network failures by displaying default Zesty ads.
  • Analytics: Click and impression tracking is automatically handled by the SDK.

API Reference

ZestyBannerView

The main component for displaying advertisements.

Initializer

public init(
    adUnitId: String,
    format: Formats,
    width: CGFloat? = nil,
    height: CGFloat? = nil
)

Parameters

  • adUnitId: Your unique ad unit identifier (must be valid UUID)
  • format: The ad format type (see Formats enum)
  • width: Optional custom width (maintains aspect ratio if height not provided)
  • height: Optional custom height (maintains aspect ratio if width not provided)

Formats Enum

public enum Formats {
    case MediumRectangle    // 300×250
    case Billboard          // 970×250
    case MobilePhoneInterstitial  // 640×1136
    case Video              // 1920×1080
}

Development

Building

swift build

Running Tests

swift test

Debug Configuration

swift build -c debug

Requirements

  • visionOS: 1.0+
  • Swift: 6.0+
  • Xcode: 15.0+

Dependencies

  • Kingfisher (8.1.1+) - Efficient image loading and caching

Contributing

We welcome contributions to the Zesty Ads SDK! Please feel free to submit issues and pull requests.

Support

For technical support and questions:


Made with ❤️ by Zesty

About

Monetize your VisionOS app with the Borellion Swift SDK

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages