Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'sessionReplay' cannot be found in forward class object 'SentryExperimentalOptions' #4497

Open
dusanristic opened this issue Nov 1, 2024 · 1 comment

Comments

@dusanristic
Copy link

dusanristic commented Nov 1, 2024

Platform

iOS

Environment

Develop

Installed

CocoaPods

Version

8.37.0

Xcode Version

15.2 & 16.0

Did it work on previous versions?

/

Steps to Reproduce

/

Expected Result

I want to enable the experimental Session Replay feature in my React Native app.
Since I initialized Sentry manually on the native side, I need to set the following parameters in the AppDelegate.mm file:

options.experimental.sessionReplay.onErrorSampleRate = 1.0;
options.experimental.sessionReplay.sessionSampleRate = 1.0;

Session Replay should be initialized successfully on native side.

Below you can find Sentry SDK init snippet code

 [SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
        options.dsn = @"XXXXXX";
        options.debug = false;
        options.experimental.sessionReplay.onErrorSampleRate = 1.0;
        options.experimental.sessionReplay.sessionSampleRate = 1.0;
        // Load values from Info.plist as dictionary
        NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
        // Extract version and dist from dictonary
        NSString* version =  [infoDict objectForKey:@"CFBundleShortVersionString"];
        NSString* dist  = [infoDict objectForKey:@"CFBundleVersion"];
        options.releaseName = [NSString stringWithFormat:@"%@%@", @"XXXXX@", version];
        options.dist = dist;
        options.environment = [infoDict objectForKey:@"logger_environment"];
  }];

Actual Result

I'm getting the following error:
Property 'sessionReplay' cannot be found in forward class object 'SentryExperimentalOptions'

I've checked the SDK, and the experimental parameter is of type SentryExperimentalOptions, which contains a public sessionReplay variable (under canImport(UIKit) condition.

Do you have any idea why I'm receiving this error?

Are you willing to submit a PR?

No response

@brustolin
Copy link
Contributor

Hello @dusanristic, thanks for reaching out.
Instead of using #import <Sentry/Sentry.h> you should use @import Sentry;
The replay feature was created in Swift, therefore you need to import the module.

Let me know if it worked for you.

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 Nov 4, 2024
@brustolin brustolin moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Nov 4, 2024
@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Status: Needs More Information
Development

No branches or pull requests

2 participants