Skip to content

Commit 1d7aba2

Browse files
author
Yogesh Singh
committed
SDK-129: improved readability in iOS Plugin file
1 parent bc4dcb6 commit 1d7aba2

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

ios/Classes/CleverTapPlugin.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ static NSString *const kCleverTapDisplayUnitsLoaded = @"onDisplayU
1010
static NSString *const kCleverTapInAppNotificationButtonTapped = @"onInAppButtonClick";
1111
static NSString *const kCleverTapInboxMessageButtonTapped = @"onInboxButtonClick";
1212

13-
@interface CleverTapPlugin : NSObject<FlutterPlugin>
13+
@interface CleverTapPlugin : NSObject < FlutterPlugin >
14+
1415
+ (instancetype)sharedInstance;
1516

1617
- (void)applicationDidLaunchWithOptions:(NSDictionary *)options;

ios/Classes/CleverTapPlugin.m

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
#import "CleverTapPlugin.h"
21
#import "CleverTap.h"
2+
#import "CleverTapPlugin.h"
33
#import "CleverTap+Inbox.h"
44
#import "CleverTapUTMDetail.h"
55
#import "CleverTap+ABTesting.h"
66
#import "CleverTapEventDetail.h"
77
#import "CleverTapSyncDelegate.h"
8-
#import "CleverTapInAppNotificationDelegate.h"
98
#import "CleverTap+DisplayUnit.h"
9+
#import "CleverTapInAppNotificationDelegate.h"
1010

11-
@interface CleverTapPlugin () <CleverTapSyncDelegate, CleverTapInAppNotificationDelegate, CleverTapDisplayUnitDelegate, CleverTapInboxViewControllerDelegate> {
12-
}
11+
@interface CleverTapPlugin () < CleverTapSyncDelegate, CleverTapInAppNotificationDelegate, CleverTapDisplayUnitDelegate, CleverTapInboxViewControllerDelegate >
1312

1413
@property (strong, nonatomic) FlutterMethodChannel *channel;
1514

@@ -243,7 +242,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
243242
result(FlutterMethodNotImplemented);
244243
}
245244

246-
# pragma mark launch
245+
246+
#pragma mark - Launch
247247

248248
- (void)getInitialUrl:(FlutterMethodCall*)call result:(FlutterResult)result {
249249
NSString *launchDeepLink = self.launchDeepLink;
@@ -289,7 +289,8 @@ - (void)registerForPush:(FlutterMethodCall *)call withResult:(FlutterResult)resu
289289
result(nil);
290290
}
291291

292-
#pragma mark Personalization
292+
293+
#pragma mark - Personalization
293294

294295
- (void)enablePersonalization:(FlutterMethodCall *)call withResult:(FlutterResult)result {
295296
[CleverTap enablePersonalization];
@@ -301,7 +302,8 @@ - (void)disablePersonalization:(FlutterMethodCall *)call withResult:(FlutterResu
301302
result(nil);
302303
}
303304

304-
#pragma mark Event API
305+
306+
#pragma mark - Event API
305307

306308
- (void)recordEvent:(FlutterMethodCall *)call withResult:(FlutterResult)result {
307309
[[CleverTap sharedInstance] recordEvent:call.arguments[@"eventName"] withProps:call.arguments[@"eventData"]];
@@ -460,6 +462,7 @@ - (void)sessionGetUTMDetails:(FlutterMethodCall *)call withResult:(FlutterResult
460462
result(res);
461463
}
462464

465+
463466
#pragma mark - Inbox
464467

465468
- (void)pushInboxNotificationViewedEventForId:(FlutterMethodCall *)call withResult:(FlutterResult)result {
@@ -592,6 +595,7 @@ - (UIColor *)ct_colorWithHexString:(NSString *)string alpha:(CGFloat)alpha {
592595
return color;
593596
}
594597

598+
595599
#pragma mark - Dynamic Variables
596600

597601
- (void)setUIEditorConnectionEnabled:(FlutterMethodCall *)call withResult:(FlutterResult)result {
@@ -719,6 +723,7 @@ - (void)getMapOfStringVariable:(FlutterMethodCall *)call withResult:(FlutterResu
719723
result(res);
720724
}
721725

726+
722727
#pragma mark - Native Display
723728

724729
- (void)getAllDisplayUnits:(FlutterMethodCall *)call withResult:(FlutterResult)result {
@@ -749,6 +754,7 @@ - (void)displayUnitsUpdated:(NSArray<CleverTapDisplayUnit *> *)displayUnits {
749754
[self postNotificationWithName:kCleverTapDisplayUnitsLoaded andBody:_dict];
750755
}
751756

757+
752758
#pragma mark - private/helpers
753759

754760
- (NSArray*)_cleverTapInboxMessagesToArray:(NSArray*) inboxMessages {
@@ -903,6 +909,7 @@ - (void)postNotificationWithName:(NSString *)name andBody:(NSDictionary *)body {
903909
[[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:body];
904910
}
905911

912+
906913
#pragma mark CleverTapSyncDelegate
907914

908915
- (void)profileDidInitialize:(NSString*)cleverTapID {

0 commit comments

Comments
 (0)