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:
- Open your project in Xcode
- Go to File β Add Package Dependencies
- Enter the repository URL:
https://github.com/zestyxyz/zesty-ads-sdk-visionos.git - Click Add Package
- Select your target and add the ZestyAdsSDK library
Manual Installation
- Add this repository as a package dependency via URL
- 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
- Sign up for a Zesty Network account at zesty.market
- Create an ad space for your visionOS app
- 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 (seeFormatsenum)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 buildRunning Tests
swift testDebug Configuration
swift build -c debugRequirements
- 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:
- π§ Email: contact@zesty.xyz
- π Documentation: docs.zesty.xyz
- π¬ Discord: Join our community
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