Skip to content

Commit

Permalink
Merge pull request #341 from Countly/reverting-temp-fixes
Browse files Browse the repository at this point in the history
Reverting temp fixes
  • Loading branch information
turtledreams authored Sep 9, 2024
2 parents 35859e4 + 64ac554 commit a23584b
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 33 deletions.
8 changes: 4 additions & 4 deletions CountlyContentBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

#import <Foundation/Foundation.h>
#if (TARGET_OS_IOS)
#import <UIKit/UIKit.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@interface CountlyContentBuilder: NSObject
#if (TARGET_OS_IOS)
+ (instancetype)sharedInstance;

/**
Expand All @@ -23,9 +26,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)exitContentZone;

#endif
NS_ASSUME_NONNULL_END
@end
#else
@interface CountlyContentBuilder: NSObject
@end
#endif
9 changes: 3 additions & 6 deletions CountlyContentBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// This code is provided under the MIT License.
//
// Please visit www.count.ly for more information.
#if (TARGET_OS_IOS)

#import "CountlyContentBuilder.h"
#import "CountlyContentBuilderInternal.h"
#import "CountlyCommon.h"

@implementation CountlyContentBuilder
#if (TARGET_OS_IOS)
+ (instancetype)sharedInstance
{
if (!CountlyCommon.sharedInstance.hasStarted)
Expand Down Expand Up @@ -45,9 +46,5 @@ - (void)changeContent:(NSArray<NSString *> *)tags
[CountlyContentBuilder.sharedInstance changeContent:tags];
}

@end
#else
#import "CountlyContentBuilder.h"
@implementation CountlyContentBuilder
@end
#endif
@end
11 changes: 6 additions & 5 deletions CountlyContentBuilderInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
// Please visit www.count.ly for more information.

#import <Foundation/Foundation.h>
#import "CountlyCommon.h"
#if (TARGET_OS_IOS)
#import <UIKit/UIKit.h>
#endif
#import "CountlyCommon.h"
NS_ASSUME_NONNULL_BEGIN
@interface CountlyContentBuilderInternal: NSObject
#if (TARGET_OS_IOS)
@property (nonatomic, strong) NSArray<NSString *> *currentTags;
@property (nonatomic, assign) NSTimeInterval requestInterval;
@property (nonatomic) ContentCallback contentCallback;
Expand All @@ -19,9 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)exitContentZone;
- (void)changeContent:(NSArray<NSString *> *)tags;

#endif
NS_ASSUME_NONNULL_END
@end
#else
@interface CountlyContentBuilderInternal: NSObject
@end
#endif

8 changes: 2 additions & 6 deletions CountlyContentBuilderInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// This code is provided under the MIT License.
//
// Please visit www.count.ly for more information.

#import "CountlyContentBuilderInternal.h"
#if (TARGET_OS_IOS)
#import "CountlyWebViewManager.h"

//TODO: improve logging, check edge cases
Expand All @@ -17,6 +15,7 @@ @implementation CountlyContentBuilderInternal {
NSTimer *_requestTimer;
NSTimer *_minuteTimer;
}
#if (TARGET_OS_IOS)
+ (instancetype)sharedInstance {
static CountlyContentBuilderInternal *instance = nil;
static dispatch_once_t onceToken;
Expand Down Expand Up @@ -206,8 +205,5 @@ - (void)showContentWithHtmlPath:(NSString *)pathToHtml placementCoordinates:(NSD
}];
});
}
@end
#else
@implementation CountlyContentBuilderInternal
@end
#endif
@end
12 changes: 7 additions & 5 deletions CountlyWebViewManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
#if (TARGET_OS_IOS)
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#endif
#import "CountlyCommon.h"

NS_ASSUME_NONNULL_BEGIN
#if (TARGET_OS_IOS)
typedef NS_ENUM(NSUInteger, AnimationType) {
AnimationTypeSlideInFromBottom,
AnimationTypeSlideInFromTop,
Expand All @@ -18,6 +21,8 @@ typedef NS_ENUM(NSUInteger, AnimationType) {
AnimationTypeIncreaseHeightFromBottom
};



@interface CountlyWebViewManager : NSObject <WKNavigationDelegate>

- (void)createWebViewWithURL:(NSURL *)url
Expand All @@ -26,10 +31,7 @@ typedef NS_ENUM(NSUInteger, AnimationType) {
dismissBlock:(void(^ __nullable)(void))dismissBlock;


NS_ASSUME_NONNULL_END
@end
#else
#import <Foundation/Foundation.h>
@interface CountlyWebViewManager : NSObject

@end
#endif
NS_ASSUME_NONNULL_END
10 changes: 5 additions & 5 deletions CountlyWebViewManager.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#if (TARGET_OS_IOS)

#import "CountlyWebViewManager.h"
#import "PassThroughBackgroundView.h"
#import "CountlyCommon.h"

//TODO: improve logging, check edge cases
#if (TARGET_OS_IOS)
@interface CountlyWebViewManager()

@property (nonatomic, strong) PassThroughBackgroundView *backgroundView;
@property (nonatomic, copy) void (^dismissBlock)(void);
@end

@implementation CountlyWebViewManager
#if (TARGET_OS_IOS)
- (void)createWebViewWithURL:(NSURL *)url
frame:(CGRect)frame
appearBlock:(void(^ __nullable)(void))appearBlock
Expand Down Expand Up @@ -241,9 +244,6 @@ - (void)closeWebView {
[self.backgroundView removeFromSuperview];
});
}
@end
#else
#import "CountlyWebViewManager.h"
@implementation CountlyWebViewManager
#endif
@end
#endif
11 changes: 10 additions & 1 deletion PassThroughBackgroundView.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@
//
// Please visit www.count.ly for more information.


#if (TARGET_OS_IOS)
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#endif

#import "CountlyCommon.h"

NS_ASSUME_NONNULL_BEGIN
#if (TARGET_OS_IOS)
@interface PassThroughBackgroundView : UIView


@property (nonatomic, strong) WKWebView *webView;
@property (nonatomic, strong) CLYButton *dismissButton;

NS_ASSUME_NONNULL_END


@end
#endif
NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion PassThroughBackgroundView.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
// This code is provided under the MIT License.
//
// Please visit www.count.ly for more information.
#if (TARGET_OS_IOS)

#import "PassThroughBackgroundView.h"

#if (TARGET_OS_IOS)
@implementation PassThroughBackgroundView

@synthesize webView;

- (instancetype)initWithFrame:(CGRect)frame {

self = [super initWithFrame:frame];
if (self) {
}
Expand All @@ -28,5 +30,7 @@ - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {

return NO;
}


@end
#endif

0 comments on commit a23584b

Please sign in to comment.