Skip to content

Commit 0468e06

Browse files
author
Brandon Sneed
committed
Add accessors for edge function data
1 parent 3b66f47 commit 0468e06

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Segment/Classes/SEGAnalytics.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#import "SEGCrypto.h"
44
#import "SEGAnalyticsConfiguration.h"
55
#import "SEGSerializableValue.h"
6+
#import "SEGMiddleware.h"
67

78
NS_ASSUME_NONNULL_BEGIN
89

@@ -218,6 +219,9 @@ NS_SWIFT_NAME(Analytics)
218219
/** Returns the registered device token of this device */
219220
- (NSString *)getDeviceToken;
220221

222+
/** Returns the configured Edge Function value */
223+
- (nullable id<SEGEdgeFunctionMiddleware>)edgeFunction;
224+
221225
@end
222226

223227
NS_ASSUME_NONNULL_END

Segment/Classes/SEGAnalytics.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,4 +562,9 @@ - (void)run:(SEGEventType)eventType payload:(SEGPayload *)payload
562562
[self.runner run:context callback:nil];
563563
}
564564

565+
- (id<SEGEdgeFunctionMiddleware>)edgeFunction
566+
{
567+
return _oneTimeConfiguration.edgeFunctionMiddleware;
568+
}
569+
565570
@end

Segment/Classes/SEGMiddleware.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,8 @@ NS_SWIFT_NAME(EdgeFunctionMiddleware)
7474
@property (nonatomic, readonly, nullable) NSArray<id<SEGMiddleware>> *sourceMiddleware;
7575
@property (nonatomic, readonly, nullable) NSArray<SEGDestinationMiddleware *> *destinationMiddleware;
7676
- (void)setEdgeFunctionData:(NSDictionary *_Nullable)data;
77+
- (void)addToDataBridge:(NSString * _Nonnull)key value:(id _Nonnull)value NS_SWIFT_NAME(addToDataBridge(key:value:));
78+
- (void)removeFromDataBridge:(NSString * _Nonnull)key NS_SWIFT_NAME(removeFromDataBridge(key:));
79+
- (NSDictionary<NSString *, id> * _Nonnull)dataBridgeSnapshot;
7780
@end
7881

0 commit comments

Comments
 (0)