Skip to content

Commit

Permalink
Fallback to action type name
Browse files Browse the repository at this point in the history
  • Loading branch information
nzagorchev committed Jan 21, 2025
1 parent 6ba80a3 commit bdb342a
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 bdb342a

Please sign in to comment.