-
Notifications
You must be signed in to change notification settings - Fork 243
/
CountlyFeedbacks.m
78 lines (62 loc) · 2.12 KB
/
CountlyFeedbacks.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// CountlyFeedbacks.m
//
// This code is provided under the MIT License.
//
// Please visit www.count.ly for more information.
//
#import "CountlyFeedbacks.h"
#import "CountlyCommon.h"
@implementation CountlyFeedbacks
#if (TARGET_OS_IOS)
+ (instancetype)sharedInstance
{
if (!CountlyCommon.sharedInstance.hasStarted)
return nil;
static CountlyFeedbacks* s_sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{s_sharedInstance = self.new;});
return s_sharedInstance;
}
- (instancetype)init
{
self = [super init];
return self;
}
- (void)enterContentZone:(NSArray<NSString *> *)tags
{
[CountlyContentBuilderInternal.sharedInstance enterContentZone:tags];
}
- (void)presentNPS {
[self presentNPS:nil widgetCallback:nil];
}
- (void)presentNPS:(NSString *)nameIDorTag {
[self presentNPS:nameIDorTag widgetCallback:nil];
}
- (void) presentNPS:(NSString *)nameIDorTag widgetCallback:(WidgetCallback) widgetCallback {
[CountlyFeedbacksInternal.sharedInstance presentNPS:nameIDorTag widgetCallback:widgetCallback];
}
- (void)presentSurvey {
[self presentSurvey:nil widgetCallback:nil];
}
- (void)presentSurvey:(NSString *)nameIDorTag {
[self presentSurvey:nameIDorTag widgetCallback:nil];
}
- (void) presentSurvey:(NSString *)nameIDorTag widgetCallback:(WidgetCallback) widgetCallback {
[CountlyFeedbacksInternal.sharedInstance presentSurvey:nameIDorTag widgetCallback:widgetCallback];
}
- (void)presentRating {
[self presentRating:nil widgetCallback:nil];
}
- (void)presentRating:(NSString *)nameIDorTag {
[self presentRating:nameIDorTag widgetCallback:nil];
}
- (void) presentRating:(NSString *)nameIDorTag widgetCallback:(WidgetCallback) widgetCallback {
[CountlyFeedbacksInternal.sharedInstance presentRating:nameIDorTag widgetCallback:widgetCallback];
}
- (void)getAvailableFeedbackWidgets:(void (^)(NSArray <CountlyFeedbackWidget *> *feedbackWidgets, NSError * error))completionHandler
{
CLY_LOG_I(@"%s %@", __FUNCTION__, completionHandler);
[CountlyFeedbacksInternal.sharedInstance getFeedbackWidgets:completionHandler];
}
#endif
@end