GuidesAPI ReferenceRelease Notes
HomeLog InHome
Release Notes

1.16.0 - iOS

ChangeLog

Added

Fixed

  • Fixed Moments Tabs layout broken on iPad with sidebar in landscape mode.
  • Universal links for stories without a page ID fail to open.

Widget Play Enhancement & Click Handler Updates

✨ What's New

Enhanced Play Method with Position Control

Widgets can now play content from specific positions using the BlazeWidgetPlayFrom enum.

widget.play()                                    // First item (default)
widget.play(from: .index(2))                     // Specific index
widget.play(from: .contentId("story-123"))       // Specific content ID

BlazeWidgetPlayFrom Enum:

public enum BlazeWidgetPlayFrom {
    case index(Int)        // Play from specific index
    case contentId(String) // Play from specific content ID
}

Supported Widgets:

  • BlazeStoriesWidgetView (UIKit & SwiftUI)
  • BlazeMomentsWidgetView (UIKit & SwiftUI)
  • BlazeVideosWidgetView (UIKit & SwiftUI)

🔴 Breaking Change: onWidgetItemClickHandler

The handler now receives parameters with context about the clicked item.

Parameter Struct

public struct BlazeWidgetItemClickParams {
    public let widgetId: String      // ID of the widget
    public let contentIndex: Int     // Zero-based index of clicked item
    public let contentId: String     // Unique content ID
}

Signature Change

Old:

widget.onWidgetItemClickHandler = {
    return .handledByApp
}

New:

widget.onWidgetItemClickHandler = { params in
    // params.widgetId, params.contentIndex, params.contentId
    return .handledByApp
}

📖 Migration Guide

If You're NOT Using onWidgetItemClickHandler

No action required - your code works without changes.

If You ARE Using onWidgetItemClickHandler

Simply add the params parameter to your handler:

// Before
widget.onWidgetItemClickHandler = {
    performCustomAction()
    return .handledByApp
}

// After  
widget.onWidgetItemClickHandler = { params in
    performCustomAction()
    return .handledByApp
}

Optional - Access the new parameters:

widget.onWidgetItemClickHandler = { params in
    print("Widget: \(params.widgetId)")
    print("Index: \(params.contentIndex)")
    print("Content ID: \(params.contentId)")
    return .handledByApp
}

📚 API Reference

Play Method

// All widgets (UIKit & SwiftUI)
public func play(from: BlazeWidgetPlayFrom = .index(0))

Handler

public var onWidgetItemClickHandler: ((BlazeWidgetItemClickParams) -> BlazeWidgetItemClickHandlerState)?