Skip to content

Commit

Permalink
Merge pull request #349 from Countly/feeback-improvements
Browse files Browse the repository at this point in the history
Feedback improvements with new interface and new methods for ease of use
  • Loading branch information
turtledreams authored Oct 23, 2024
2 parents c579a28 + 7f0174c commit c6f2cd0
Show file tree
Hide file tree
Showing 16 changed files with 743 additions and 509 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## x.x.x
* Added `CountlyFeedbacks:` interface with new view methods (Access with `Countly.sharedInstance.feedback`):
* Method to present feedback widget (wih an optional widget selector(name, ID or tag) string and a Callback):
* `presentNPS`
* `presentSurvey`
* `presentRating`
* `getAvailableFeedbackWidgets` method to retrieve available feedback widgets with a completion handler.

* Deprecated `getFeedbackWidgets` method, you should use `[feedback getAvailableFeedbackWidgets:]` method instead

## 24.7.3
* Added current view names to event segmentation based on the `enablePreviousNameRecording` (Experimental!)
* Updated the SDK to ensure compatibility with the latest server response models
Expand Down
2 changes: 1 addition & 1 deletion Countly-PL.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|

s.subspec 'Core' do |core|
core.source_files = '*.{h,m}'
core.public_header_files = 'Countly.h', 'CountlyUserDetails.h', 'CountlyConfig.h', 'CountlyFeedbackWidget.h', 'CountlyRCData.h', 'CountlyRemoteConfig.h', 'CountlyViewTracking.h', 'CountlyExperimentInformation.h', 'CountlyAPMConfig.h', 'CountlySDKLimitsConfig.h', 'Resettable.h', "CountlyCrashesConfig.h", "CountlyCrashData.h", "CountlyContentBuilder.h", "CountlyExperimentalConfig.h", "CountlyContentConfig.h"
core.public_header_files = 'Countly.h', 'CountlyUserDetails.h', 'CountlyConfig.h', 'CountlyFeedbackWidget.h', 'CountlyRCData.h', 'CountlyRemoteConfig.h', 'CountlyViewTracking.h', 'CountlyExperimentInformation.h', 'CountlyAPMConfig.h', 'CountlySDKLimitsConfig.h', 'Resettable.h', "CountlyCrashesConfig.h", "CountlyCrashData.h", "CountlyContentBuilder.h", "CountlyExperimentalConfig.h", "CountlyContentConfig.h", "CountlyFeedbacks.h"
core.preserve_path = 'countly_dsym_uploader.sh'
core.ios.frameworks = ['Foundation', 'UIKit', 'UserNotifications', 'CoreLocation', 'WebKit', 'CoreTelephony', 'WatchConnectivity']
end
Expand Down
9 changes: 7 additions & 2 deletions Countly.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "CountlyFeedbackWidget.h"
#import "CountlyViewTracking.h"
#import "CountlyContentBuilder.h"
#import "CountlyFeedbacks.h"
#import "Resettable.h"
#if (TARGET_OS_IOS || TARGET_OS_OSX)
#import <UserNotifications/UserNotifications.h>
Expand Down Expand Up @@ -676,8 +677,7 @@ NS_ASSUME_NONNULL_BEGIN
* @discussion - Current device ID is @c CLYTemporaryDeviceID.
* @param completionHandler A completion handler block to be executed when list is fetched successfully or there is an error.
*/
- (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> * __nullable feedbackWidgets, NSError * __nullable error))completionHandler;

- (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> * __nullable feedbackWidgets, NSError * __nullable error))completionHandler DEPRECATED_MSG_ATTRIBUTE("Use '[feedback getAvailableFeedbackWidgets:]' method instead!");

/**
* This is an experimental feature and it can have breaking changes
Expand All @@ -686,6 +686,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (CountlyContentBuilder *_Nonnull) content;

/**
* Interface variable to access feedback widget functionalities.
* @discussion Feedback widget interface for developer to interact with SDK.
*/
- (CountlyFeedbacks *) feedback;
#endif


Expand Down
23 changes: 14 additions & 9 deletions Countly.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ - (void)startWithConfig:(CountlyConfig *)config
}

#if (TARGET_OS_IOS)
CountlyFeedbacks.sharedInstance.message = config.starRatingMessage;
CountlyFeedbacks.sharedInstance.sessionCount = config.starRatingSessionCount;
CountlyFeedbacks.sharedInstance.disableAskingForEachAppVersion = config.starRatingDisableAskingForEachAppVersion;
CountlyFeedbacks.sharedInstance.ratingCompletionForAutoAsk = config.starRatingCompletion;
[CountlyFeedbacks.sharedInstance checkForStarRatingAutoAsk];
CountlyFeedbacksInternal.sharedInstance.message = config.starRatingMessage;
CountlyFeedbacksInternal.sharedInstance.sessionCount = config.starRatingSessionCount;
CountlyFeedbacksInternal.sharedInstance.disableAskingForEachAppVersion = config.starRatingDisableAskingForEachAppVersion;
CountlyFeedbacksInternal.sharedInstance.ratingCompletionForAutoAsk = config.starRatingCompletion;
[CountlyFeedbacksInternal.sharedInstance checkForStarRatingAutoAsk];
#endif

if(config.disableLocation)
Expand Down Expand Up @@ -1240,7 +1240,7 @@ - (void)askForStarRating:(void(^)(NSInteger rating))completion
{
CLY_LOG_I(@"%s %@", __FUNCTION__, completion);

[CountlyFeedbacks.sharedInstance showDialog:completion];
[CountlyFeedbacksInternal.sharedInstance showDialog:completion];
}

- (void)presentFeedbackWidgetWithID:(NSString *)widgetID completionHandler:(void (^)(NSError * error))completionHandler
Expand All @@ -1262,28 +1262,33 @@ - (void)presentRatingWidgetWithID:(NSString *)widgetID closeButtonText:(NSString

CLY_LOG_I(@"%s %@ %@ %@", __FUNCTION__, widgetID, closeButtonText, completionHandler);

[CountlyFeedbacks.sharedInstance presentRatingWidgetWithID:widgetID closeButtonText:closeButtonText completionHandler:completionHandler];
[CountlyFeedbacksInternal.sharedInstance presentRatingWidgetWithID:widgetID closeButtonText:closeButtonText completionHandler:completionHandler];
}

- (void)recordRatingWidgetWithID:(NSString *)widgetID rating:(NSInteger)rating email:(NSString * _Nullable)email comment:(NSString * _Nullable)comment userCanBeContacted:(BOOL)userCanBeContacted
{
CLY_LOG_I(@"%s %@ %ld %@ %@ %d", __FUNCTION__, widgetID, (long)rating, email, comment, userCanBeContacted);

[CountlyFeedbacks.sharedInstance recordRatingWidgetWithID:widgetID rating:rating email:email comment:comment userCanBeContacted:userCanBeContacted];
[CountlyFeedbacksInternal.sharedInstance recordRatingWidgetWithID:widgetID rating:rating email:email comment:comment userCanBeContacted:userCanBeContacted];
}

- (void)getFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> *feedbackWidgets, NSError * error))completionHandler
{
CLY_LOG_I(@"%s %@", __FUNCTION__, completionHandler);

[CountlyFeedbacks.sharedInstance getFeedbackWidgets:completionHandler];
[CountlyFeedbacksInternal.sharedInstance getFeedbackWidgets:completionHandler];
}

- (CountlyContentBuilder *) content
{
return CountlyContentBuilder.sharedInstance;
}

- (CountlyFeedbacks *) feedback
{
return CountlyFeedbacks.sharedInstance;
}

#endif


Expand Down
2 changes: 1 addition & 1 deletion Countly.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|

s.subspec 'Core' do |core|
core.source_files = '*.{h,m}'
core.public_header_files = 'Countly.h', 'CountlyUserDetails.h', 'CountlyConfig.h', 'CountlyFeedbackWidget.h', 'CountlyRCData.h', 'CountlyRemoteConfig.h', 'CountlyViewTracking.h', 'CountlyExperimentInformation.h', 'CountlyAPMConfig.h', 'CountlySDKLimitsConfig.h', 'Resettable.h', "CountlyCrashesConfig.h", "CountlyCrashData.h", "CountlyContentBuilder.h", "CountlyExperimentalConfig.h", "CountlyContentConfig.h"
core.public_header_files = 'Countly.h', 'CountlyUserDetails.h', 'CountlyConfig.h', 'CountlyFeedbackWidget.h', 'CountlyRCData.h', 'CountlyRemoteConfig.h', 'CountlyViewTracking.h', 'CountlyExperimentInformation.h', 'CountlyAPMConfig.h', 'CountlySDKLimitsConfig.h', 'Resettable.h', "CountlyCrashesConfig.h", "CountlyCrashData.h", "CountlyContentBuilder.h", "CountlyExperimentalConfig.h", "CountlyContentConfig.h", "CountlyFeedbacks.h"
core.preserve_path = 'countly_dsym_uploader.sh'
core.ios.frameworks = ['Foundation', 'UIKit', 'UserNotifications', 'CoreLocation', 'WebKit', 'CoreTelephony', 'WatchConnectivity']
end
Expand Down
24 changes: 16 additions & 8 deletions Countly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
39924ED62BEBD20F00139F91 /* CountlyCrashData.m in Sources */ = {isa = PBXBuildFile; fileRef = 39924ED52BEBD20F00139F91 /* CountlyCrashData.m */; };
39924ED82BEBD22100139F91 /* CountlyCrashData.h in Headers */ = {isa = PBXBuildFile; fileRef = 39924ED72BEBD22100139F91 /* CountlyCrashData.h */; settings = {ATTRIBUTES = (Public, ); }; };
399B46502C52813700AD384E /* CountlyLocationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 399B464F2C52813700AD384E /* CountlyLocationTests.swift */; };
39BDF7572CC7CA870066DE7C /* CountlyFeedbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 39BDF7562CC7CA870066DE7C /* CountlyFeedbacks.h */; settings = {ATTRIBUTES = (Public, ); }; };
39BDF7592CC7CA920066DE7C /* CountlyFeedbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 39BDF7582CC7CA920066DE7C /* CountlyFeedbacks.m */; };
39EE1F102C8B341E0016D1BF /* CountlyExperimentalConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 3903429B2C8051B400238C96 /* CountlyExperimentalConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
3B20A9872245225A00E3D7AE /* Countly.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A9852245225A00E3D7AE /* Countly.h */; settings = {ATTRIBUTES = (Public, ); }; };
3B20A9B22245228700E3D7AE /* CountlyConnectionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A98D2245228300E3D7AE /* CountlyConnectionManager.h */; };
Expand Down Expand Up @@ -85,8 +87,8 @@
D219374C248AC71C00E5798B /* CountlyPerformanceMonitoring.m in Sources */ = {isa = PBXBuildFile; fileRef = D219374A248AC71C00E5798B /* CountlyPerformanceMonitoring.m */; };
D249BF5E254D3D180058A6C2 /* CountlyFeedbackWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = D249BF5C254D3D170058A6C2 /* CountlyFeedbackWidget.h */; settings = {ATTRIBUTES = (Public, ); }; };
D249BF5F254D3D180058A6C2 /* CountlyFeedbackWidget.m in Sources */ = {isa = PBXBuildFile; fileRef = D249BF5D254D3D180058A6C2 /* CountlyFeedbackWidget.m */; };
D2CFEF972545FBE80026B044 /* CountlyFeedbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = D2CFEF952545FBE80026B044 /* CountlyFeedbacks.h */; };
D2CFEF982545FBE80026B044 /* CountlyFeedbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CFEF962545FBE80026B044 /* CountlyFeedbacks.m */; };
D2CFEF972545FBE80026B044 /* CountlyFeedbacksInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = D2CFEF952545FBE80026B044 /* CountlyFeedbacksInternal.h */; };
D2CFEF982545FBE80026B044 /* CountlyFeedbacksInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CFEF962545FBE80026B044 /* CountlyFeedbacksInternal.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -143,6 +145,8 @@
39924ED52BEBD20F00139F91 /* CountlyCrashData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CountlyCrashData.m; sourceTree = "<group>"; };
39924ED72BEBD22100139F91 /* CountlyCrashData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountlyCrashData.h; sourceTree = "<group>"; };
399B464F2C52813700AD384E /* CountlyLocationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountlyLocationTests.swift; sourceTree = "<group>"; };
39BDF7562CC7CA870066DE7C /* CountlyFeedbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountlyFeedbacks.h; sourceTree = "<group>"; };
39BDF7582CC7CA920066DE7C /* CountlyFeedbacks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CountlyFeedbacks.m; sourceTree = "<group>"; };
3B20A9822245225A00E3D7AE /* Countly.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Countly.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B20A9852245225A00E3D7AE /* Countly.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Countly.h; sourceTree = "<group>"; };
3B20A9862245225A00E3D7AE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -181,8 +185,8 @@
D219374A248AC71C00E5798B /* CountlyPerformanceMonitoring.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyPerformanceMonitoring.m; sourceTree = "<group>"; };
D249BF5C254D3D170058A6C2 /* CountlyFeedbackWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyFeedbackWidget.h; sourceTree = "<group>"; };
D249BF5D254D3D180058A6C2 /* CountlyFeedbackWidget.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyFeedbackWidget.m; sourceTree = "<group>"; };
D2CFEF952545FBE80026B044 /* CountlyFeedbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyFeedbacks.h; sourceTree = "<group>"; };
D2CFEF962545FBE80026B044 /* CountlyFeedbacks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyFeedbacks.m; sourceTree = "<group>"; };
D2CFEF952545FBE80026B044 /* CountlyFeedbacksInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyFeedbacksInternal.h; sourceTree = "<group>"; };
D2CFEF962545FBE80026B044 /* CountlyFeedbacksInternal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyFeedbacksInternal.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -224,6 +228,8 @@
3B20A9782245225A00E3D7AE = {
isa = PBXGroup;
children = (
39BDF7562CC7CA870066DE7C /* CountlyFeedbacks.h */,
39BDF7582CC7CA920066DE7C /* CountlyFeedbacks.m */,
39002D092C8B2E450049394F /* CountlyContentConfig.h */,
39002D0A2C8B2E450049394F /* CountlyContentConfig.m */,
3961C6AF2C6633C000DD38BA /* CountlyWebViewManager.h */,
Expand Down Expand Up @@ -274,8 +280,8 @@
3B20A9AA2245228500E3D7AE /* CountlyDeviceInfo.m */,
3B20A99E2245228400E3D7AE /* CountlyEvent.h */,
3B20A9952245228400E3D7AE /* CountlyEvent.m */,
D2CFEF952545FBE80026B044 /* CountlyFeedbacks.h */,
D2CFEF962545FBE80026B044 /* CountlyFeedbacks.m */,
D2CFEF952545FBE80026B044 /* CountlyFeedbacksInternal.h */,
D2CFEF962545FBE80026B044 /* CountlyFeedbacksInternal.m */,
D249BF5C254D3D170058A6C2 /* CountlyFeedbackWidget.h */,
D249BF5D254D3D180058A6C2 /* CountlyFeedbackWidget.m */,
3B20A99A2245228400E3D7AE /* CountlyLocationManager.h */,
Expand Down Expand Up @@ -326,6 +332,7 @@
files = (
39924ECE2BEBD0B700139F91 /* CountlyCrashesConfig.h in Headers */,
1A478D032AB314750056A5E7 /* CountlyExperimentInformation.h in Headers */,
39BDF7572CC7CA870066DE7C /* CountlyFeedbacks.h in Headers */,
3B20A9D32245228700E3D7AE /* CountlyPushNotifications.h in Headers */,
3B20A9C42245228700E3D7AE /* CountlyUserDetails.h in Headers */,
3961C6B72C6633C000DD38BA /* PassThroughBackgroundView.h in Headers */,
Expand Down Expand Up @@ -357,7 +364,7 @@
D249BF5E254D3D180058A6C2 /* CountlyFeedbackWidget.h in Headers */,
39924ED82BEBD22100139F91 /* CountlyCrashData.h in Headers */,
399117D22C69F73D00DC4C66 /* CountlyContentBuilderInternal.h in Headers */,
D2CFEF972545FBE80026B044 /* CountlyFeedbacks.h in Headers */,
D2CFEF972545FBE80026B044 /* CountlyFeedbacksInternal.h in Headers */,
39002D0B2C8B2E450049394F /* CountlyContentConfig.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -489,10 +496,11 @@
3B20A9D42245228700E3D7AE /* CountlyPersistency.m in Sources */,
3B20A9B32245228700E3D7AE /* CountlyNotificationService.m in Sources */,
3948A8572BAC2E7D002D09AA /* CountlySDKLimitsConfig.m in Sources */,
D2CFEF982545FBE80026B044 /* CountlyFeedbacks.m in Sources */,
D2CFEF982545FBE80026B044 /* CountlyFeedbacksInternal.m in Sources */,
1A3110632A7128CD001CB507 /* CountlyViewData.m in Sources */,
3961C6B92C6633C000DD38BA /* PassThroughBackgroundView.m in Sources */,
399117D32C69F73D00DC4C66 /* CountlyContentBuilderInternal.m in Sources */,
39BDF7592CC7CA920066DE7C /* CountlyFeedbacks.m in Sources */,
1A423E9E2A271E46008C4757 /* CountlyRCData.m in Sources */,
3B20A9CB2245228700E3D7AE /* CountlyRemoteConfig.m in Sources */,
3B20A9BD2245228700E3D7AE /* CountlyConnectionManager.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion CountlyCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import "CountlyCrashReporter.h"
#import "CountlyConfig.h"
#import "CountlyViewTrackingInternal.h"
#import "CountlyFeedbacks.h"
#import "CountlyFeedbacksInternal.h"
#import "CountlyFeedbackWidget.h"
#import "CountlyPushNotifications.h"
#import "CountlyNotificationService.h"
Expand Down
8 changes: 8 additions & 0 deletions CountlyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger
{
WIDGET_APPEARED,
WIDGET_CLOSED,
} WidgetState;

typedef void (^WidgetCallback)(WidgetState widgetState);

//NOTE: Countly features
typedef NSString* CLYFeature NS_EXTENSIBLE_STRING_ENUM;
#if (TARGET_OS_IOS)
Expand Down
2 changes: 1 addition & 1 deletion CountlyConsentManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ - (void)setConsentForFeedback:(BOOL)consentForFeedback
{
CLY_LOG_D(@"Consent for Feedback is given.");

[CountlyFeedbacks.sharedInstance checkForStarRatingAutoAsk];
[CountlyFeedbacksInternal.sharedInstance checkForStarRatingAutoAsk];
}
else
{
Expand Down
7 changes: 7 additions & 0 deletions CountlyFeedbackWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Please visit www.count.ly for more information.

#import <Foundation/Foundation.h>
#import "CountlyConfig.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -41,6 +42,12 @@ extern NSString* const kCountlyReservedEventRating;
*/
- (void)presentWithAppearBlock:(void(^ __nullable)(void))appearBlock andDismissBlock:(void(^ __nullable)(void))dismissBlock;

/**
* Modally presents the feedback widget above the top visible view controller and executes given blocks.
* @discussion Calls to this method will be ignored if consent for @c CLYConsentFeedback is not given while @c requiresConsent flag is set on initial configuration.
* @param widgetCallback Block to be executed when widget is displayed/dismissed
*/
- (void)presentWithCallback:(WidgetCallback) widgetCallback;
/**
* Fetches feedback widget's data to be used for manually presenting it.
* @discussion When feedback widget's data is fetched successfully, @c completionHandler will be executed with an @c NSDictionary
Expand Down
25 changes: 22 additions & 3 deletions CountlyFeedbackWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ - (void)present
- (void)presentWithAppearBlock:(void(^ __nullable)(void))appearBlock andDismissBlock:(void(^ __nullable)(void))dismissBlock
{
CLY_LOG_I(@"%s %@ %@", __FUNCTION__, appearBlock, dismissBlock);
[self presentWithCallback:^(WidgetState widgetState) {
if(appearBlock && widgetState == WIDGET_APPEARED) {
appearBlock();
}

if(dismissBlock && widgetState == WIDGET_CLOSED) {
dismissBlock();
}
}];
}

- (void)presentWithCallback:(WidgetCallback) widgetCallback;
{
CLY_LOG_I(@"%s %@", __FUNCTION__, widgetCallback);
if (!CountlyConsentManager.sharedInstance.consentForFeedback)
return;
__block CLYInternalViewController* webVC = CLYInternalViewController.new;
Expand All @@ -75,15 +89,20 @@ - (void)presentWithAppearBlock:(void(^ __nullable)(void))appearBlock andDismissB
{
[webVC dismissViewControllerAnimated:YES completion:^
{
if (dismissBlock)
dismissBlock();
CLY_LOG_D(@"Feedback widget dismissed. Widget ID: %@, Name: %@", self.ID, self.name);
if (widgetCallback)
widgetCallback(WIDGET_CLOSED);
webVC = nil;
}];
[self recordReservedEventForDismissing];
};
[webView addSubview:dismissButton];
[dismissButton positionToTopRight];
[CountlyCommon.sharedInstance tryPresentingViewController:webVC withCompletion:appearBlock];
[CountlyCommon.sharedInstance tryPresentingViewController:webVC withCompletion:^{
CLY_LOG_D(@"Feedback widget presented. Widget ID: %@, Name: %@", self.ID, self.name);
if(widgetCallback)
widgetCallback(WIDGET_APPEARED);
}];
}

- (void)getWidgetData:(void (^)(NSDictionary * __nullable widgetData, NSError * __nullable error))completionHandler
Expand Down
Loading

0 comments on commit c6f2cd0

Please sign in to comment.