Skip to content

feat: unified sdk support #29

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

Merged
merged 1 commit into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AmplitudeSessionReplay.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ Pod::Spec.new do |s|

s.ios.deployment_target = '13.0'
s.vendored_frameworks = "Frameworks/AmplitudeSessionReplay.xcframework"

s.dependency 'AmplitudeCore', '>= 1.0.10', '< 2.0.0'
end
1 change: 0 additions & 1 deletion AmplitudeSwiftSessionReplayPlugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '13.0'
s.source_files = 'Sources/AmplitudeSwiftSessionReplayPlugin/**/*'

s.dependency 'AmplitudeSwift', '>= 1.9.2', '< 2.0'
s.dependency 'AmplitudeSessionReplay', amplitude_version
end
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import AmplitudeCore;
@import Foundation;
@import ObjectiveC;
@import UIKit;
Expand All @@ -301,40 +302,28 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));

#if defined(__OBJC__)

@class NSString;

SWIFT_PROTOCOL("_TtP22AmplitudeSessionReplay6Logger_")
@protocol Logger
- (void)errorWithMessage:(NSString * _Nonnull)message;
- (void)warnWithMessage:(NSString * _Nonnull)message;
- (void)logWithMessage:(NSString * _Nonnull)message;
- (void)debugWithMessage:(NSString * _Nonnull)message;
@end

typedef SWIFT_ENUM(NSInteger, MaskLevel, open) {
MaskLevelLight = 0,
MaskLevelMedium = 1,
MaskLevelConservative = 2,
};

typedef SWIFT_ENUM(NSInteger, ServerZone, open) {
ServerZoneUS = 0,
ServerZoneEU = 1,
};

@class NSString;
@protocol CoreLogger;
@class RemoteConfigClient;

SWIFT_CLASS_NAMED("SessionReplay")
@interface AMPSessionReplay : NSObject
@property (nonatomic, readonly, copy) NSString * _Nonnull apiKey;
@property (nonatomic, readonly, strong) id <Logger> _Nonnull logger;
@property (nonatomic, readonly, strong) id <CoreLogger> _Nonnull logger;
@property (nonatomic, readonly) BOOL enableRemoteConfig;
@property (nonatomic, readonly) float sampleRate;
@property (nonatomic, readonly) enum MaskLevel maskLevel;
@property (nonatomic) BOOL optOut;
@property (nonatomic) int64_t sessionId;
@property (nonatomic, copy) NSString * _Nullable deviceId;
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull additionalEventProperties;
- (nonnull instancetype)initWithApiKey:(NSString * _Nonnull)apiKey deviceId:(NSString * _Nullable)deviceId sessionId:(int64_t)sessionId optOut:(BOOL)optOut sampleRate:(float)sampleRate webviewMappings:(NSDictionary<NSString *, NSString *> * _Nonnull)webviewMappings logger:(id <Logger> _Nullable)logger serverZone:(enum ServerZone)serverZone maskLevel:(enum MaskLevel)maskLevel enableRemoteConfig:(BOOL)enableRemoteConfig OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)initWithApiKey:(NSString * _Nonnull)apiKey deviceId:(NSString * _Nullable)deviceId sessionId:(int64_t)sessionId optOut:(BOOL)optOut sampleRate:(float)sampleRate webviewMappings:(NSDictionary<NSString *, NSString *> * _Nonnull)webviewMappings logger:(id <CoreLogger> _Nullable)logger serverZone:(enum AMPServerZone)serverZone maskLevel:(enum MaskLevel)maskLevel enableRemoteConfig:(BOOL)enableRemoteConfig remoteConfigClient:(RemoteConfigClient * _Nullable)remoteConfigClient OBJC_DESIGNATED_INITIALIZER;
- (void)start;
- (void)stop;
- (void)flush;
Expand All @@ -345,6 +334,14 @@ SWIFT_CLASS_NAMED("SessionReplay")



SWIFT_CLASS("_TtC22AmplitudeSessionReplay19SessionReplayPlugin")
@interface SessionReplayPlugin : NSObject
- (nonnull instancetype)initWithSampleRate:(float)sampleRate maskLevel:(enum MaskLevel)maskLevel enableRemoteConfig:(BOOL)enableRemoteConfig webviewMappings:(NSDictionary<NSString *, NSString *> * _Nonnull)webviewMappings autoStart:(BOOL)autoStart;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


@interface UIView (SWIFT_EXTENSION(AmplitudeSessionReplay))
@property (nonatomic) BOOL amp_isBlocked;
@end
Expand Down
Binary file not shown.
Loading