Contents

borellion/sdk-visionos

Monetize your VisionOS app with Zesty's Swift SDK.

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 File β†’ Add 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 Targets β†’ YOUR_TARGET β†’ Build Phases β†’ Link 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

Package Metadata

Repository: borellion/sdk-visionos

Homepage: https://docs.zesty.xyz/guides/developers/integrate/visionos

Stars: 4

Forks: 0

Open issues: 0

Default branch: main

Primary language: swift

License: Other

README: README.md