Skip to content

Commit d0518f1

Browse files
authored
fix(action): Inbox data returns string when payload is string (#82) LP-6234
1 parent 9bdd9c4 commit d0518f1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Leanplum-SDK/Classes/Leanplum.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3523,7 +3523,17 @@ - (NSDictionary *)dictionaryNamed:(NSString *)name
35233523
[Leanplum throwError:@"[LPActionContext dictionaryNamed:] Empty name parameter provided."];
35243524
return nil;
35253525
}
3526-
return (NSDictionary *) [self objectNamed:name];
3526+
LP_TRY
3527+
id object = [self objectNamed:name];
3528+
if ([object isKindOfClass:[NSDictionary class]]) {
3529+
return (NSDictionary *) object;
3530+
}
3531+
3532+
if ([object isKindOfClass:[NSString class]]) {
3533+
return [LPJSON JSONFromString:object];
3534+
}
3535+
LP_END_TRY
3536+
return nil;
35273537
}
35283538

35293539
- (NSArray *)arrayNamed:(NSString *)name

0 commit comments

Comments
 (0)