Skip to content

Commit

Permalink
Merge pull request #248 from Countly/feedback-rating-tags
Browse files Browse the repository at this point in the history
Added feedback rating widget and tags
  • Loading branch information
ArtursKadikis committed Sep 11, 2023
2 parents 34979d9 + 174c8c4 commit 089e8d5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 23.8.1
- Expanded feedback widget functionality. Added ability to use rating widgets.
- Added functionality to access tags for feedback widgets.
- Fixed SPM public header issues of `CountlyViewTracking.h`

## 23.8.0
Expand Down
2 changes: 1 addition & 1 deletion Countly-PL.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Countly-PL'
s.version = '23.8.0'
s.version = '23.8.1'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
s.homepage = 'https://github.com/Countly/countly-sdk-ios'
Expand Down
2 changes: 1 addition & 1 deletion Countly.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Countly'
s.version = '23.8.0'
s.version = '23.8.1'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'Countly is an innovative, real-time, open source mobile analytics platform.'
s.homepage = 'https://github.com/Countly/countly-sdk-ios'
Expand Down
4 changes: 2 additions & 2 deletions Countly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 23.8.0;
MARKETING_VERSION = 23.8.1;
PRODUCT_BUNDLE_IDENTIFIER = ly.count.CountlyiOSSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -479,7 +479,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 23.8.0;
MARKETING_VERSION = 23.8.1;
PRODUCT_BUNDLE_IDENTIFIER = ly.count.CountlyiOSSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion CountlyCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ @interface CountlyCommon ()
#endif
@end

NSString* const kCountlySDKVersion = @"23.8.0";
NSString* const kCountlySDKVersion = @"23.8.1";
NSString* const kCountlySDKName = @"objc-native-ios";

NSString* const kCountlyErrorDomain = @"ly.count.ErrorDomain";
Expand Down
3 changes: 3 additions & 0 deletions CountlyFeedbackWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ NS_ASSUME_NONNULL_BEGIN
typedef NSString* CLYFeedbackWidgetType NS_EXTENSIBLE_STRING_ENUM;
extern CLYFeedbackWidgetType const CLYFeedbackWidgetTypeSurvey;
extern CLYFeedbackWidgetType const CLYFeedbackWidgetTypeNPS;
extern CLYFeedbackWidgetType const CLYFeedbackWidgetTypeRating;

extern NSString* const kCountlyReservedEventSurvey;
extern NSString* const kCountlyReservedEventNPS;
extern NSString* const kCountlyReservedEventRating;

@interface CountlyFeedbackWidget : NSObject
#if (TARGET_OS_IOS)

@property (nonatomic, readonly) CLYFeedbackWidgetType type;
@property (nonatomic, readonly) NSString* ID;
@property (nonatomic, readonly) NSString* name;
@property (nonatomic, readonly) NSArray<NSString* >* tags;
@property (nonatomic, readonly) NSDictionary* data;

/**
Expand Down
12 changes: 9 additions & 3 deletions CountlyFeedbackWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
#import <WebKit/WebKit.h>
#endif

CLYFeedbackWidgetType const CLYFeedbackWidgetTypeSurvey = @"survey";
CLYFeedbackWidgetType const CLYFeedbackWidgetTypeNPS = @"nps";
CLYFeedbackWidgetType const CLYFeedbackWidgetTypeSurvey = @"survey";
CLYFeedbackWidgetType const CLYFeedbackWidgetTypeNPS = @"nps";
CLYFeedbackWidgetType const CLYFeedbackWidgetTypeRating = @"rating";

NSString* const kCountlyReservedEventSurvey = @"[CLY]_survey";
NSString* const kCountlyReservedEventNPS = @"[CLY]_nps";
NSString* const kCountlyReservedEventRating = @"[CLY]_rating";

NSString* const kCountlyFBKeyClosed = @"closed";
NSString* const kCountlyFBKeyShown = @"shown";
Expand All @@ -22,6 +24,7 @@ @interface CountlyFeedbackWidget ()
@property (nonatomic) CLYFeedbackWidgetType type;
@property (nonatomic) NSString* ID;
@property (nonatomic) NSString* name;
@property (nonatomic) NSArray<NSString*>* tags;
@property (nonatomic) NSDictionary* data;
@end

Expand All @@ -35,6 +38,7 @@ + (CountlyFeedbackWidget *)createWithDictionary:(NSDictionary *)dictionary
feedback.ID = dictionary[kCountlyFBKeyID];
feedback.type = dictionary[@"type"];
feedback.name = dictionary[@"name"];
feedback.tags = dictionary[@"tg"];
return feedback;
}

Expand Down Expand Up @@ -209,6 +213,8 @@ - (void)recordReservedEventWithSegmentation:(NSDictionary *)segm
eventName = kCountlyReservedEventSurvey;
else if ([self.type isEqualToString:CLYFeedbackWidgetTypeNPS])
eventName = kCountlyReservedEventNPS;
else if ([self.type isEqualToString:CLYFeedbackWidgetTypeRating])
eventName = kCountlyReservedEventRating;

if (!eventName)
{
Expand All @@ -227,7 +233,7 @@ - (void)recordReservedEventWithSegmentation:(NSDictionary *)segm

- (NSString *)description
{
NSString *customDescription = [NSString stringWithFormat:@"\rID: %@, Type: %@ \rName: %@", self.ID, self.type, self.name];
NSString *customDescription = [NSString stringWithFormat:@"\rID: %@, Type: %@ \rName: %@ \rTags: %@", self.ID, self.type, self.name, self.tags];
return [[super description] stringByAppendingString:customDescription];
}

Expand Down

0 comments on commit 089e8d5

Please sign in to comment.