iOS quickstart
Install the SDK, display a Bubble widget in UIKit or SwiftUI, and play your first story.
1. Choose a widget
Start with an iOS app targeting iOS 15 or later and an internet-connected iPhone or simulator. To try the examples as written, use the public demo Team ID join-showcase-sdk and widget alias welcome-showcase.
For your own content, publish a mobile widget with at least one story in JOIN Studio. Copy its Team ID and widget alias from the Integration tab. Replace both demo values in the examples below. For the first run, choose a widget that requires no audience or product filter.
2. Add the SDK to your app target
In Xcode, open File → Add Package Dependencies, enter https://github.com/teamjoin/join-stories-sdk-ios-spm, select the current release, and add the JoinStoriesSDK product to your application target. In Swift, the module name is JOINStoriesSDK. Build the target once to verify that the import resolves.
For CocoaPods or manual embedding, use the installation reference, then continue with step 3.
3. Initialize once at launch
In a UIKit app, add the call below to your existing app delegate’s application(_:didFinishLaunchingWithOptions:). Keep the rest of your startup code. In a SwiftUI app, add the delegate below and attach it to your existing App using @UIApplicationDelegateAdaptor. If your app already has an adapted delegate, add the call there.
import UIKit
import JOINStoriesSDK
final class StoriesAppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
JOINStories.initSDK(teamId: "join-showcase-sdk")
return true
}
}
import SwiftUI
@main
struct StoriesApp: App {
@UIApplicationDelegateAdaptor(StoriesAppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup { StoriesScreen() }
}
}
The SwiftUI app uses StoriesScreen from step 4. If your app waits for consent before contacting JOIN, defer both initialization and widget creation until your app permits them. Consent and verification
4. Display a Bubble widget
Choose the example for your screen. In UIKit, present StoriesViewController or make it your scene’s root view controller. In SwiftUI, display StoriesScreen in your existing window. Keep the widget in the view hierarchy when unrelated screen state changes.
import UIKit
import JOINStoriesSDK
final class StoriesViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let widget = BubbleTriggerView(alias: "welcome-showcase")
widget.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(widget)
let guide = view.safeAreaLayoutGuide
NSLayoutConstraint.activate([
widget.topAnchor.constraint(equalTo: guide.topAnchor),
widget.leadingAnchor.constraint(equalTo: guide.leadingAnchor),
widget.trailingAnchor.constraint(equalTo: guide.trailingAnchor)
])
}
}
import SwiftUI
import JOINStoriesSDK
struct StoriesScreen: View {
var body: some View {
VStack {
BubbleTrigger(alias: "welcome-showcase")
Spacer()
}
}
}
5. Open a story and return to your screen
Run the app, open the widget screen and wait for a thumbnail. Tap it, check that the selected story plays, then close the player. You should return to the same screen with the widget still visible.
If you see an empty row or a player that never opens, follow Diagnose a widget. Once playback works, try Card layouts, the vertical player or analytics events. The public demo includes a UIKit screen and a SwiftUI screen.
Updated about 4 hours ago
