InAppStory SDK Documentation

website·Indexed 34 days ago

https://docs.inappstory.com/

Developer guides and API references for integrating InAppStory stories, interactive widgets, and in-app messaging across Android, iOS, React, and JS platforms. Includes documentation on story feeds, product carousels, game integration, SSL pinning, and statistical event tracking.

Tokens
189.8K
Snippets
968
Records
1.3K
Agent score
56%

What's inside InAppStory

  1. Overview of InAppStory Checkout

    Checkout is an add-on to the products widget that enables displaying products directly inside stories and managing a user's shopping cart. It facilitates a two-way integration where the SDK emits events (like adding items to a cart) and the host application responds by updating the cart state and returning the current state to the SDK.
  2. Overview of InAppStory Checkout functionality

    Checkout is an add-on to the products widget that allows developers to display products inside stories and manage a user's shopping cart. It functions as a two-way integration: the SDK emits events when users interact with products, and the host application responds by updating the cart and providing the current cart state back to the SDK.
  3. Overview of In-App Messaging (IAM) presentation types

    The In-App Messaging (IAM) feature in the React Native SDK (available from version 0.27.0) supports four presentation styles:

    • fullScreen: Full-screen presentation
    • bottomSheet: Bottom sheet (modal)
    • popUp: Pop-up window
    • toast: Toast notification. Toast messages do not require additional setup and automatically pass touch gestures to the underlying UI.
  4. StoryLinkClickEvent data structure

    The payload passed to the storyLinkClickHandler follows the StoryLinkClickEvent interface, providing details about the story and the specific link clicked.
    interface StoryLinkClickEvent {
        src: string;
        data: StoryLinkClickEventData;
    }
    
    interface StoryLinkClickEventData {
        id: number;          // Story ID
        index: number;       // Slide index
        url: string;         // Link URL
        elementId: string;   // Element ID in the story
    }
  5. Handle In-App Message event data

    When an In-App Message is shown, the SDK provides iamData containing metadata about the message. This includes the name of the widget and a data dictionary (Dictionary<String, Any>?) containing the activated widget's specific data fields.
  6. Implement Onboarding stories in InAppStory

    Onboarding stories are a specialized story type designed to open on top of other app screens. They are typically used for short introductions, feature explanations, and guiding new users to increase app activation. To ensure users do not skip critical information during an onboarding flow, use the 'Prohibit closing' option in the story settings.
  7. In-App Message (IAM) Feature Support

    The SDK provides several advanced configuration options for In-App Messages (IAM), including:

    • Backdrop Support: Ability to add backdrops to IAMs.
    • Backgrounds: Support for transparent and gradient backgrounds.
    • Close Behavior: Ability to disable the close feature in IAMs.
    • Targeting: Support for tags, limits, and priority for IAM delivery.
    • Device Support: Full tablet support for all IAM types.
  8. StoryCard data model and methods

    The StoryCard object provides metadata about an individual story and helper methods for rendering its visual representation.
    // StoryCard Properties
    interface StoryCard {
      id: number; // Unique identifier
      title: string;
      titleColor: string; // HEX format
      backgroundColor: string; // HEX format
      background: { color: string; gradient: boolean };
      favorite: boolean;
      like: number;
      deeplink: string | null; // URL for navigation on click
      hideInReader: boolean | null;
      gameInstance: { id?: string } | undefined;
      hasAudio: boolean | null;
      isFavoriteCard: boolean; // Represents a favorite stories collection
      isUgcCard: boolean; // User Generated Content card
      isOpened: boolean; // Currently being viewed
      videoCoverSrc: string | null;
    }
    
    // StoryCard Methods
    // Calculates aspect ratio based on view variant
    storyCard.getAspectRatio(variant: StoriesListCardViewVariant): number;
    
    // Returns image URL for a specific quality (e.g., "medium")
    storyCard.getImageSrcByCoverQuality(coverQuality: StoriesListCardCoverQuality): string | undefined;
    
    // Handles click interaction
    storyCard.onClick(index?: number): void;
  9. Handle story loading events in iOS SDK

    The SDK triggers specific notifications when story lists are loaded. Both events fire on initial load and during refreshes. The userInfo dictionary provides metadata about the loaded content.
    - StoriesLoaded: Triggered when the standard story list is loaded. StoryView is ready.
      - userInfo: { "count": Int, "feed": String }
    
    - UGCStoriesLoaded: Triggered when User Generated Content (UGC) stories are loaded. StoryUGCView is ready.
      - userInfo: { "count": Int, "stories": Array<Dictionary<String, Any>> }
        - Each story object contains: "id", "title", "tags", "slidesCount", and "ugcPayload" (Dictionary<String, Any>).
  10. Manage In-App Story settings using InAppStoryManager

    The InAppStoryManager is a singleton class used to manage placeholders, tags, user sessions, and story reader configurations. To call any of its methods, you must access the singleton instance via InAppStoryManager.instance.
    await InAppStoryManager.instance.methodName();
  11. Handle widget interaction events in InAppStory Android SDK

    The widgetEvent callback is triggered when a user interacts with a widget within a story. It provides details about the slide, the specific widget event, and associated data.
    fun widgetEvent(slideData: SlideData, widgetEventName: String, widgetData: Map<String, String?>, feed: String?) {
        // slideData: information about the shown slide (index) and its story (id, title, slides count)
        // widgetEventName: name of the interacted widget
        // widgetData: parameters from the widget
        // feed: feed where stories reader was opened (may be null)
    }