Skip to content

Commit 00cfc5b

Browse files
committed
feat: unified sdk support
1 parent 98fff1d commit 00cfc5b

File tree

37 files changed

+13170
-11325
lines changed

37 files changed

+13170
-11325
lines changed

AmplitudeSessionReplay.podspec

+2
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ Pod::Spec.new do |s|
1313

1414
s.ios.deployment_target = '13.0'
1515
s.vendored_frameworks = "Frameworks/AmplitudeSessionReplay.xcframework"
16+
17+
s.dependency 'AmplitudeCore', '>= 1.0.10', '< 2.0.0'
1618
end

AmplitudeSwiftSessionReplayPlugin.podspec

-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ Pod::Spec.new do |s|
1414
s.ios.deployment_target = '13.0'
1515
s.source_files = 'Sources/AmplitudeSwiftSessionReplayPlugin/**/*'
1616

17-
s.dependency 'AmplitudeSwift', '>= 1.9.2', '< 2.0'
1817
s.dependency 'AmplitudeSessionReplay', amplitude_version
1918
end

Frameworks/AmplitudeSessionReplay.xcframework/ios-arm64/AmplitudeSessionReplay.framework/Headers/AmplitudeSessionReplay-Swift.h

+14-17
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
277277
#if __has_warning("-Watimport-in-framework-header")
278278
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
279279
#endif
280+
@import AmplitudeCore;
280281
@import Foundation;
281282
@import ObjectiveC;
282283
@import UIKit;
@@ -301,40 +302,28 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
301302

302303
#if defined(__OBJC__)
303304

304-
@class NSString;
305-
306-
SWIFT_PROTOCOL("_TtP22AmplitudeSessionReplay6Logger_")
307-
@protocol Logger
308-
- (void)errorWithMessage:(NSString * _Nonnull)message;
309-
- (void)warnWithMessage:(NSString * _Nonnull)message;
310-
- (void)logWithMessage:(NSString * _Nonnull)message;
311-
- (void)debugWithMessage:(NSString * _Nonnull)message;
312-
@end
313-
314305
typedef SWIFT_ENUM(NSInteger, MaskLevel, open) {
315306
MaskLevelLight = 0,
316307
MaskLevelMedium = 1,
317308
MaskLevelConservative = 2,
318309
};
319310

320-
typedef SWIFT_ENUM(NSInteger, ServerZone, open) {
321-
ServerZoneUS = 0,
322-
ServerZoneEU = 1,
323-
};
324-
311+
@class NSString;
312+
@protocol CoreLogger;
313+
@class RemoteConfigClient;
325314

326315
SWIFT_CLASS_NAMED("SessionReplay")
327316
@interface AMPSessionReplay : NSObject
328317
@property (nonatomic, readonly, copy) NSString * _Nonnull apiKey;
329-
@property (nonatomic, readonly, strong) id <Logger> _Nonnull logger;
318+
@property (nonatomic, readonly, strong) id <CoreLogger> _Nonnull logger;
330319
@property (nonatomic, readonly) BOOL enableRemoteConfig;
331320
@property (nonatomic, readonly) float sampleRate;
332321
@property (nonatomic, readonly) enum MaskLevel maskLevel;
333322
@property (nonatomic) BOOL optOut;
334323
@property (nonatomic) int64_t sessionId;
335324
@property (nonatomic, copy) NSString * _Nullable deviceId;
336325
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull additionalEventProperties;
337-
- (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;
326+
- (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;
338327
- (void)start;
339328
- (void)stop;
340329
- (void)flush;
@@ -345,6 +334,14 @@ SWIFT_CLASS_NAMED("SessionReplay")
345334

346335

347336

337+
SWIFT_CLASS("_TtC22AmplitudeSessionReplay19SessionReplayPlugin")
338+
@interface SessionReplayPlugin : NSObject
339+
- (nonnull instancetype)initWithSampleRate:(float)sampleRate maskLevel:(enum MaskLevel)maskLevel enableRemoteConfig:(BOOL)enableRemoteConfig webviewMappings:(NSDictionary<NSString *, NSString *> * _Nonnull)webviewMappings autoStart:(BOOL)autoStart;
340+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
341+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
342+
@end
343+
344+
348345
@interface UIView (SWIFT_EXTENSION(AmplitudeSessionReplay))
349346
@property (nonatomic) BOOL amp_isBlocked;
350347
@end

0 commit comments

Comments
 (0)