react-native-xnotify-stories
v1.0.2
Published
React Native wrapper for the XNotify Stories SDK (iOS IosStorySDKAnother.xcframework + Android xnoitify-stories-sdk)
Maintainers
Readme
react-native-xnotify-stories
React Native wrapper for the XNotify Stories SDK.
- iOS — vendors the local
IosStorySDKAnother.xcframework(inios/Frameworks/). - Android — pulls
com.github.dilawarabbas1:xnoitify-stories-sdk:stg-1.0.1from JitPack.
Exposes an embeddable <StoriesView /> component (backed by a native ViewManager)
plus an initialize(storyKey) module method.
Installation
npm install react-native-xnotify-stories
# or
yarn add react-native-xnotify-storiesiOS
cd ios && pod installThe package vendors ios/Frameworks/IosStorySDKAnother.xcframework via the podspec —
no extra steps. Minimum iOS deployment target is 15.0 (the framework's MinimumOSVersion).
Android
Autolinking handles registration. The Stories SDK lives on JitPack, so the package's
android/build.gradle already adds:
repositories { maven { url "https://jitpack.io" } }If your app restricts repositories in settings.gradle
(dependencyResolutionManagement), add JitPack there too:
dependencyResolutionManagement {
repositories {
maven { url "https://jitpack.io" }
}
}Usage
import React, { useEffect } from 'react';
import { Button, StyleSheet, View } from 'react-native';
import { StoriesView, XNotifyStories } from 'react-native-xnotify-stories';
export default function App() {
useEffect(() => {
// Initialize once (or pass `storyKey` to <StoriesView /> directly).
XNotifyStories.initialize('YOUR_STORY_KEY');
}, []);
return (
<View style={styles.container}>
{/* Embeddable stories list */}
<StoriesView layout="grid" style={styles.stories} />
{/* Full-screen default story (modal on iOS, Activity on Android) */}
<Button
title="Open default story"
onPress={() => XNotifyStories.showDefaultStory()}
/>
</View>
);
}
const styles = StyleSheet.create({
container: { flex: 1 },
stories: { height: 160 },
});<StoriesView /> props
| Prop | Type | Default | Description |
| ---------- | --------------------------------- | -------- | ----------- |
| layout | 'normal' \| 'large' \| 'grid' | normal | Maps to StoryStyle (Android) / StoryLayout (iOS) |
| storyKey | string | — | If set, initializes the SDK before rendering |
| style | ViewStyle | — | Give it a size — the view does not size itself |
layout mapping: normal → NORMAL_HORIZONTAL / .normal, large → LARGE_HORIZONTAL / .large, grid → GRID / .grid.
Module
XNotifyStories.initialize(storyKey: string): void
// Full-screen default story: modal on iOS, StoryWebViewActivity on Android.
XNotifyStories.showDefaultStory(): void⚠️ Integration notes (must read)
- iOS is wired against the API discovered from the framework binary
(
StorySDK.shared.initialize,showStories(layout:),showDefaultStory(onClose:),StoryLayout.normal/.large/.grid). - Android is wired against
com.xnotify.storysdk.StorySDK(initialize(apiKey),showStories(activity, recyclerView, style),showDefaultStory(activity)) andcom.xnotify.storysdk.Class.StoryStyle.
License
MIT
