Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SS-iOS-SDK

Native iOS SDK for embedding SecondStreet promotions inside any iOS app — no browser takeover.

Supports iOS 13+ · Swift · Swift Package Manager


Installation

Swift Package Manager (Xcode)

File → Add Package Dependencies
→ paste: https://github.com/secondstreet/ss-ios-sdk
→ Add Package

Or add to Package.swift

dependencies: [
    .package(url: "https://github.com/secondstreet/ss-ios-sdk", from: "1.0.0")
]

Usage

Import

import SecondStreetSDK

Modal (full or partial screen)

// Full screen
PromotionKit.show(promoId: "your-promo-id", from: self)

// 90% bottom sheet
PromotionKit.show(
    promoId:       "your-promo-id",
    from:          self,
    heightPercent: 90
)

Inline (renders directly in your layout)

let promoView = PromotionKit.inline(promoId: "your-promo-id")
stackView.addArrangedSubview(promoView)

Floating Button (FAB)

PromotionKit.attach(
    promoId: "your-promo-id",
    to:      self,
    icon:    "🎁",
    label:   "Win a Prize"
)

With user context + callbacks

PromotionKit.show(
    promoId:  "your-promo-id",
    from:     self,
    userId:   currentUser.id,
    token:    currentUser.authToken,
    delegate: self
)

extension MyViewController: PromotionDelegate {
    func promotionDidComplete(promoId: String, reward: [String: Any]?) {
        let coupon = reward?["couponCode"] as? String
        showRewardBanner(coupon: coupon)
    }
    func promotionDidClose(promoId: String) {
        resumeVideo()
    }
}

Parameters

Parameter Type Default Description
promoId String required Your promotion ID
userId String? nil Optional user ID
token String? nil Optional auth token
baseUrl String promos.secondstreet.com Your platform base URL
heightPercent Int 100 Screen height % for modal

Requirements

  • iOS 13.0+
  • Swift 5.5+
  • Xcode 13+

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages