Displaying a Scrollable Feed
Display a Scrollable Feed anywhere in your app.
Displaying a Scrollable Feed in your app is simple. Pick a place where you'd like to include a Scrollable Feed and use the provided FlagshipFeed for your platform. The feed will automatically fetch the relevant Posts for the user and communicate via the registered delegate or event handlers.
Android
Use the FlagshipFragment to present a Scrollable Feed wherever you want within your application. This is typically done as one of the tabs of your app.
FlagshipFragment.Builder(this@MainActivity)
.setType(FlagshipFragmentType.FEED_FRAGMENT)
.build()
A FlagshipFeedIntent is also available:
val feedIntent = FlagshipFeedIntent.Builder(this@MainActivity)
.build()
startActivity(feedIntent)
You can optionally force the Feed to render within the Safe Area:
FlagshipFragment.Builder(this@MainActivity)
.setType(FlagshipFragmentType.FEED_FRAGMENT)
.setShowInSafeArea(true)
.build()
iOS
Use the FlagshipFeedViewController to present a Scrollable Feed wherever you want within your application. This is typically done as the root view controller on one of the tabs of your app.
// Initialize a FlagshipFeedViewController
let flagshipFeedViewController = FlagshipFeedViewController()
// Optional - register a delegate to handle events
flagshipFeedViewController.delegate = self
// Present the feed view controller
YOUR_NAVIGATION_CONTROLLER.setViewControllers([flagshipFeedViewController], animated: false)
You can optionally force the Feed to render within the Safe Area:
let vc = FlagshipFeedViewController.init(showInSafeArea: true)
React Native
Use the FlagshipFeed component to present a Scrollable Feed wherever you want within your application. This is typically done as one of the tabs of your app.
return (
<FlagshipFeed
// Optional - provide your event handlers
handleShowStory={YOUR_SHOW_STORY_HANDLER}
handleDeepLink={YOUR_DEEPLINK_HANDLER}
handleAnalytics={YOUR_ANALYTICS_HANDLER}
handleError={YOUR_ERROR_HANDLER}
/>
);
Displaying a Stacked Feed
Displaying a Stacked Feed in your app, for example, a set of full-screen videos, is similar to a Scrollable Feed. The stack will automatically fetch the relevant Posts for the user and communicate via the registered delegate or event handlers.
Android
Use the FlagshipFragment to present a Stack wherever you want within your application. This is typically done as one of the tabs of your app.
FlagshipFragment.Builder(this@MainActivity)
.setType(FlagshipFragmentType.STACKED_FRAGMENT)
.build()
A FlagshipStackedIntent is also available:
val stackedIntent = FlagshipStackedIntent.Builder(this@MainActivity)
.build()
startActivity(stackedIntent)
iOS
Use the FlagshipStackedViewController to present a Stacked Feed wherever you want within your application.
// Initialize a FlagshipStackedViewController
let flagshipStackedViewController = FlagshipStackedViewController()
// Optional - register a delegate to handle events
flagshipStackedViewController.delegate = self
// Present the stacked view controller
YOUR_NAVIGATION_CONTROLLER.setViewControllers([flagshipStackedViewController], animated: false)
React Native
Use the FlagshipStacked component to present a Stacked Feed wherever you want within your application.
return (
<FlagshipStacked
// Optional - provide your event handlers
handleShowStory={YOUR_SHOW_STORY_HANDLER}
handleDeepLink={YOUR_DEEPLINK_HANDLER}
handleAnalytics={YOUR_ANALYTICS_HANDLER}
handleError={YOUR_ERROR_HANDLER}
/>
);