Skip to content

feature: add onFullstoryDidStartSession lifecycle API#147

Open
RyanCommits wants to merge 1 commit intomasterfrom
ryanwang/feature-add-on-session-start-lifecycle-API
Open

feature: add onFullstoryDidStartSession lifecycle API#147
RyanCommits wants to merge 1 commit intomasterfrom
ryanwang/feature-add-on-session-start-lifecycle-API

Conversation

@RyanCommits
Copy link
Contributor

@RyanCommits RyanCommits commented Feb 25, 2026

FE-466

With the Guides & Services work, it revealed a requirement to tap into these native callback APIs: iOS & Android . The requirement is that on React Native, we should be able to react when a session splits or resumes. Right now we have an onReady API that accepts one-off promises that get resolved when a session starts.

Changes

  1. Non-breaking changes to the onReady API. Our current onReady API accepts one promise. Multiple uses to the FullStory.onReady().then() API deletes the previous. We now store multiple onReady promises in an array to allow multiple FullStory.onReady().then() calls.
  2. Added onFullstoryDidStartSession. Used the official React Native new architecture event emitter docs. This API is only supported on the new architecture, and will no-op on old architecture. This work is part of a push to get Guides & Surveys done, so I think legacy architecture support is optional for now.

This API maps to onReady and fullstoryDidStartSession on Android and iOS, respectively. If recordOnStart is true, it is likely that the session will already have started before onFullstoryDidStartSession is registered on the JavaScript side. Therefore will only respond to subsequent session starts. Users will have to continue to leverage the on onReady API to capture a session that is already in progress.

Tested on RN 66 & 84.

- (instancetype)init {
self = [super init];
if (self) {
FS.delegate = self;
Copy link
Contributor Author

@RyanCommits RyanCommits Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now set the delegate on app start, whereas before we set it when we call onReady

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants