Skip to content

Commit

Permalink
Fixes iOS macros for webview and content builder
Browse files Browse the repository at this point in the history
  • Loading branch information
ijunaid committed Sep 9, 2024
1 parent 46a367f commit 64ac554
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CountlyContentBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@


#import <Foundation/Foundation.h>
#if (TARGET_OS_IOS)
#import <UIKit/UIKit.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@interface CountlyContentBuilder: NSObject
#if (TARGET_OS_IOS)
Expand Down
2 changes: 2 additions & 0 deletions CountlyContentBuilderInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// Please visit www.count.ly for more information.

#import <Foundation/Foundation.h>
#if (TARGET_OS_IOS)
#import <UIKit/UIKit.h>
#endif
#import "CountlyCommon.h"
NS_ASSUME_NONNULL_BEGIN
@interface CountlyContentBuilderInternal: NSObject
Expand Down
12 changes: 7 additions & 5 deletions CountlyWebViewManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
//
// 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)
Expand All @@ -19,17 +21,17 @@ typedef NS_ENUM(NSUInteger, AnimationType) {
AnimationTypeIncreaseHeightFromBottom
};

#endif


@interface CountlyWebViewManager : NSObject <WKNavigationDelegate>

#if (TARGET_OS_IOS)
- (void)createWebViewWithURL:(NSURL *)url
frame:(CGRect)frame
appearBlock:(void(^ __nullable)(void))appearBlock
dismissBlock:(void(^ __nullable)(void))dismissBlock;

#endif

NS_ASSUME_NONNULL_END

@end
#endif
NS_ASSUME_NONNULL_END
5 changes: 3 additions & 2 deletions CountlyWebViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#import "CountlyCommon.h"

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

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

@implementation CountlyWebViewManager
Expand Down Expand Up @@ -246,3 +246,4 @@ - (void)closeWebView {
}
#endif
@end
#endif
13 changes: 10 additions & 3 deletions PassThroughBackgroundView.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@
// 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

#if (TARGET_OS_IOS)

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

NS_ASSUME_NONNULL_END


@end
#endif
NS_ASSUME_NONNULL_END
6 changes: 4 additions & 2 deletions PassThroughBackgroundView.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

#import "PassThroughBackgroundView.h"

#if (TARGET_OS_IOS)
@implementation PassThroughBackgroundView

@synthesize webView;

- (instancetype)initWithFrame:(CGRect)frame {
#if (TARGET_OS_IOS)

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

#endif

@end
#endif

0 comments on commit 64ac554

Please sign in to comment.