From bdb342a15aa9591b7f3953a15a8571cb82c6931c Mon Sep 17 00:00:00 2001 From: Nikola Zagorchev Date: Tue, 21 Jan 2025 16:21:48 +0200 Subject: [PATCH] Fallback to action type name --- .../InApps/CustomTemplates/CTTemplateContext.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CleverTapSDK/InApps/CustomTemplates/CTTemplateContext.m b/CleverTapSDK/InApps/CustomTemplates/CTTemplateContext.m index 1cf1e472..9d5f3cb2 100644 --- a/CleverTapSDK/InApps/CustomTemplates/CTTemplateContext.m +++ b/CleverTapSDK/InApps/CustomTemplates/CTTemplateContext.m @@ -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 *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];