Skip to content

Commit

Permalink
Fallback to action type name (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzagorchev authored Jan 22, 2025
1 parent a1e8ade commit 83382c2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CleverTapSDK/InApps/CustomTemplates/CTTemplateContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,24 @@ - (id)valueForArgument:(CTTemplateArgument *)arg {
return nil;
}

- (NSString *)actionName:(CTNotificationAction *)action {
NSString *name = action.customTemplateInAppData.templateName;
if (!name) {
name = [CTInAppUtils inAppActionTypeString:action.type];
}
if (!name) {
name = @"";
}
return name;
}

- (NSString *)debugDescription {
NSMutableArray<NSString *> *argsDescription = [NSMutableArray array];
for (NSString *key in self.argumentValues) {
NSString *value;
if ([self.argumentValues[key] isKindOfClass:[CTNotificationAction class]]) {
CTNotificationAction *action = self.argumentValues[key];
NSString *name = action.customTemplateInAppData.templateName ? action.customTemplateInAppData.templateName : @"";
NSString *name = [self actionName:action];
value = [NSString stringWithFormat:@"Action: %@", name];
} else {
value = [self.argumentValues[key] debugDescription];
Expand Down

0 comments on commit 83382c2

Please sign in to comment.