2 min read

Dynamic Content

Available from SS24

Dynamic Content is an exiting new technology that we hope to eventually replace most or all of the SDK. Dynamic Content is our first SwiftUI feature and is itself it's own architecture for building features by composing components.

Dynamic Content can be presented anywhere as a Page or within a predefined Slot and is managed via our App Manager web tool.

# Present content as a page.
content/{id}?title={title}

Replace id with the Dynamic Content identifier and title with a good page title (optional). You can copy the deeplink, or simply scan the QR code, for content on App Manager.

Set up

Whilst v25 brings the base of Dynamic Content (limited slots, components and an integration with Dynamic Yield), SS24 is the first major release of Dynamic Content using SwiftUI components with a new simplified architecture.

Dynamic Content requires no developer set up.

However, clients are able to customise their API to return slotContent without an integration. We are also working new interfaces into our App Manager to dynamically customise UI in the future.

Slots

Some features have predefined Slots, filled from the slotContent of their associated BE response data. Slots are easy to add to any feature with slotContent or using a custom data solution to provide their content dynamically.

Slots are views that can be added anywhere in a view hierarchy to provide an area for dynamic content.

Over time we will roll out slots to more of the SDK features or even build entire features from them. Check feature specific documentation for the SDK predefined slots.

Generally slots are added to vertical layouts with no fixed sizes. If a slot has no content, or fails to resolve content, it collapses to zero size, hiding itself.

Slot content should have an implicit size; stacks have an implicit size based on the size of their stacked components. However, scrolls and some containers do not have an implicit size as they fit themselves to the size of their container whilst their content is less than or extents beyond their own size.

Putting content with no implicit size in a slot will lead to a zero height slot (the content not showing).

Slots size themselves based on their content. Depending on the content and scenario this can cause interesting (good or bad) animations which can be improved by ensuring components that have size or aspect ratios have them set correctly.

Components

Components make up Dynamic Content. They are parts of your apps UI that can be composed to make other components, content and screens.

For example, a blog post is likely to consist of a title, hero image, then sections of text and images. We can represent this as the following composed component heirarchy and serve it as Dynamic Content:

  • Vertical-Scroll
    • Image
    • Text
    • Spacer
    • Text
    • Text
    • Horizontal-Stack
      • Text
      • Image
    • Text
    • Product-Carousel

In the above you can see how you can nest horizontal-stacks to split content and even add other components such as a product carousel to allows users to browse the products mentioned in the content above it.

This Dynamic Content would be saved as a single component (the Vertical-Scroll that owns the rest) and then exposed to your users by deeplinking to it from banners or anywhere else in your app.

Components are JSON, so creating your own component is easy. Follow the tutorials in the PoqSDK docs bundle for the PoqUI framework to implement them.

Dynamic Yield

You can use Dynamic Yield to return content set up directly within Dynamic Yield.

The FE integration handles tracking directly with Dynamic Yield and adds a header to all network requests that BE middleware intercepts to return content for slots.

Slot content can be returned from multiple sources where the order of priority is determined by the order of the BE middleware; generally if Dynamic Yield can return content, it would override content set in App Manager.

History

  • SS24: Full initial release with base set of components.
  • v25: Limited release with Dynamic Yield integration for slots.