Product documentation and training for Shipcode.
Displaying Portals (React Native SDK)

Overview

The Feeds SDK gives you the ability to render content created in Flagship™ Create. This includes support for Portals, which render local React Native components in your Feed.

Registering Portal Components

You'll need to register the components you wish to use as Portals with the Flagship constructor. The constructor accepts an optional portalComponents object that is keyed by the Portal ID and the value being a reference to your desired React Native function component.

The Portal's ID needs to match the ID provided to the Portal component registered in Flagship™ Create.

 

React Native

const MyPortalComponent = () => (
<Text>My Example Component</Text>
);

// In this example, the Portal created in Flagship Create would need to also
// have the ID my-portal-component. You can register as many Portals as you need here.
const portals = {
'my-portal-component': MyPortalComponent
};

const { FlagshipService, FlagshipFeed, FlagshipStory } = Flagship({
appId: env?.feeds?.appId,
...
portalComponents: portals
});
Did this answer your question?