Skip to content

Commit 5d91620

Browse files
authored
Expose Action Context arguments and message id (#392)
* Expose Action Context arguments and message id
1 parent 16f63f6 commit 5d91620

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Leanplum-SDK/Classes/Features/Actions/LPActionContext-Internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
2424
priority:(nullable NSNumber *)priority;
2525

2626
@property (readonly, strong) NSString *name;
27-
@property (readonly, strong) NSString *messageId;
2827
@property (readonly, strong) NSString *originalMessageId;
2928
@property (readonly, strong) NSNumber *priority;
30-
@property (readonly, strong, nullable) NSDictionary *args;
3129
@property (readonly, strong, nullable) LPActionContext *parentContext;
3230
@property (readonly) int contentVersion;
3331
@property (readonly, strong, nullable) NSString *key;

Leanplum-SDK/Classes/Features/Actions/LPActionContext.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ - (NSString *)actionName
181181
return _name;
182182
}
183183

184+
- (NSDictionary *)args
185+
{
186+
[self setProperArgs];
187+
return [_args copy];
188+
}
189+
184190
- (void)setProperArgs
185191
{
186192
if (!_preventRealtimeUpdating && [[LPVarCache sharedCache] contentVersion] > _contentVersion) {

Leanplum-SDK/Classes/LPActionContext.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ NS_SWIFT_NAME(ActionContext)
3131

3232
- (instancetype)init NS_UNAVAILABLE;
3333

34+
/**
35+
* The id of the message in the context if present
36+
*/
37+
@property (readonly, strong) NSString *messageId;
38+
39+
/**
40+
* Copy of the Context arguments
41+
*/
42+
@property (readonly, strong, nullable) NSDictionary *args;
43+
3444
- (NSString *)actionName
3545
NS_SWIFT_NAME(action());
3646

0 commit comments

Comments
 (0)