Skip to content

Commit cb19d01

Browse files
authored
Merge pull request #432 from Countly/contents_immersive
feat: immersive contents
2 parents fa934c3 + 920bc27 commit cb19d01

18 files changed

+499
-152
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,34 @@ jobs:
2121
matrix:
2222
env:
2323
[
24-
{ os_version: 14, sdk: "macosx14.5" },
25-
{ os_version: 14, sdk: "iphoneos17.5" },
26-
{ os_version: 14, sdk: "appletvos17.5" },
27-
{ os_version: 14, sdk: "watchos10.5" },
28-
{ os_version: 14, sdk: "xros1.2" },
29-
{ os_version: 13, sdk: "iphoneos17.2" },
30-
{ os_version: 13, sdk: "macosx14.2" },
31-
{ os_version: 13, sdk: "appletvos17.2" },
32-
{ os_version: 13, sdk: "watchos10.2" },
33-
{ os_version: 13, sdk: "xros1.0" },
34-
{ os_version: 15, sdk: "macosx15.5" },
35-
{ os_version: 15, sdk: "iphoneos18.5" },
36-
{ os_version: 15, sdk: "appletvos18.5" },
37-
{ os_version: 15, sdk: "watchos11.5" },
38-
{ os_version: 15, sdk: "xros2.5" },
24+
{ os_version: 14, sdk: "macosx14.5", xcode: "15.4" },
25+
{ os_version: 14, sdk: "iphoneos17.5", xcode: "15.4"},
26+
{ os_version: 14, sdk: "appletvos17.5", xcode: "15.4"},
27+
{ os_version: 14, sdk: "watchos10.5", xcode: "15.4" },
28+
{ os_version: 14, sdk: "xros1.2", xcode: "15.4" },
29+
{ os_version: 14, sdk: "iphoneos17.2", xcode: "15.2" },
30+
{ os_version: 14, sdk: "macosx14.2", xcode: "15.2" },
31+
{ os_version: 14, sdk: "appletvos17.2", xcode: "15.2" },
32+
{ os_version: 14, sdk: "watchos10.2", xcode: "15.2" },
33+
{ os_version: 14, sdk: "xros1.0", xcode: "15.2" },
34+
{ os_version: 15, sdk: "macosx15.5", xcode: "16.4" },
35+
{ os_version: 15, sdk: "iphoneos18.5", xcode: "16.4" },
36+
{ os_version: 15, sdk: "appletvos18.5", xcode: "16.4" },
37+
{ os_version: 15, sdk: "watchos11.5", xcode: "16.4" },
38+
{ os_version: 15, sdk: "xros2.5", xcode: "16.4" },
39+
{ os_version: 26, sdk: "macosx26.2", xcode: "26.2"},
40+
{ os_version: 26, sdk: "iphoneos26.2", xcode: "26.2"},
41+
{ os_version: 26, sdk: "appletvos26.2", xcode: "26.2"},
42+
{ os_version: 26, sdk: "watchos26.2", xcode: "26.2"},
43+
{ os_version: 26, sdk: "xros26.2", xcode: "26.2"}
3944
]
4045
steps:
4146
# To check the github context
4247
- name: Checkout SDK code
4348
uses: actions/checkout@v4
49+
50+
- name: Set up Xcode
51+
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.env.xcode }}.app
4452

4553
- name: Build for the sdk ${{ matrix.env.sdk }} on macOS ${{ matrix.env.os_version }}
4654
run: xcodebuild -project Countly.xcodeproj build -sdk ${{ matrix.env.sdk }}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## XX.XX.XX
2+
* Added a new config option "setWebviewDisplayOption: WebViewDisplayOption" to control how Content and Feedback Widgets are presented.
3+
* IMMERSIVE mode (default): Full-screen display (except cutouts).
4+
* SAFE_AREA mode: Omits status bar, navigation bar and cutouts when displaying WebView.
5+
16
## 25.4.8
27
* Mitigated an issue where "giveAllConsent" did not include metrics consent.
38

Countly.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ - (void)startWithConfig:(CountlyConfig *)config
280280
if(config.content.getZoneTimerInterval){
281281
CountlyContentBuilderInternal.sharedInstance.zoneTimerInterval = config.content.getZoneTimerInterval;
282282
}
283+
if(config.content.getWebViewDisplayOption){
284+
CountlyContentBuilderInternal.sharedInstance.webViewDisplayOption = config.content.getWebViewDisplayOption;
285+
}
283286
#endif
284287

285288
[CountlyPerformanceMonitoring.sharedInstance startWithConfig:config.apm];

Countly.xcodeproj/project.pbxproj

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
3B20A9D42245228700E3D7AE /* CountlyPersistency.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B20A9AF2245228600E3D7AE /* CountlyPersistency.m */; };
8484
3B20A9D62245228700E3D7AE /* CountlyConsentManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B20A9B12245228700E3D7AE /* CountlyConsentManager.h */; };
8585
4C3A4CA02EB4C40000827FEA /* EventThreadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3A4C9F2EB4C40000827FEA /* EventThreadTests.swift */; };
86+
96095A5F2F20105600FDE933 /* TouchDelegatingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 96095A5E2F20105600FDE933 /* TouchDelegatingView.h */; };
8687
962485BA2D9E971800FA3C20 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962485B92D9E971400FA3C20 /* TestUtils.swift */; };
8788
96329DE02D9426F300BFD641 /* CountlyServerConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96329DDF2D9426F300BFD641 /* CountlyServerConfigTests.swift */; };
8889
96329DE22D94299D00BFD641 /* ServerConfigBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96329DE12D94299D00BFD641 /* ServerConfigBuilder.swift */; };
@@ -91,10 +92,15 @@
9192
965A2E9D2DDDCDAC00F28F6A /* CountlyHealthTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 965A2E9A2DDDCDAC00F28F6A /* CountlyHealthTracker.h */; };
9293
9673567F2EC60CD400C742D8 /* TestURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9673567E2EC60CD400C742D8 /* TestURLProtocol.swift */; };
9394
968426812BF2302C007B303E /* CountlyConnectionManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968426802BF2302C007B303E /* CountlyConnectionManagerTests.swift */; };
95+
9691B7652F1FA35500A6ADCB /* CountlyOverlayWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 9691B7642F1FA35500A6ADCB /* CountlyOverlayWindow.h */; };
96+
9691B7672F1FA35C00A6ADCB /* CountlyOverlayWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 9691B7662F1FA35C00A6ADCB /* CountlyOverlayWindow.m */; };
9497
969E5BCE2ECC4D3200AB406A /* CountlyConsentManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 969E5BCD2ECC4D2C00AB406A /* CountlyConsentManagerTests.swift */; };
98+
96AAC90A2F20B7790021CA5A /* TouchDelegatingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 96AAC9092F20B7790021CA5A /* TouchDelegatingView.m */; };
9599
96C05AB02E82936F0028A976 /* CountlyHealthTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96C05AAF2E8293630028A976 /* CountlyHealthTrackerTests.swift */; };
96100
96DA74BB2D9FB687006FA6FF /* MockFeedbackWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96DA74BA2D9FB687006FA6FF /* MockFeedbackWidget.swift */; };
97101
96E680422BFF89AC0091E105 /* CountlyCrashReporterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E680412BFF89AC0091E105 /* CountlyCrashReporterTests.swift */; };
102+
96F80BE72F17D066006B4F71 /* CountlyWebViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 96F80BE62F17D066006B4F71 /* CountlyWebViewController.h */; };
103+
96F80BE92F17D06F006B4F71 /* CountlyWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F80BE82F17D06F006B4F71 /* CountlyWebViewController.m */; };
98104
D219374B248AC71C00E5798B /* CountlyPerformanceMonitoring.h in Headers */ = {isa = PBXBuildFile; fileRef = D2193749248AC71C00E5798B /* CountlyPerformanceMonitoring.h */; };
99105
D219374C248AC71C00E5798B /* CountlyPerformanceMonitoring.m in Sources */ = {isa = PBXBuildFile; fileRef = D219374A248AC71C00E5798B /* CountlyPerformanceMonitoring.m */; };
100106
D249BF5E254D3D180058A6C2 /* CountlyFeedbackWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = D249BF5C254D3D170058A6C2 /* CountlyFeedbackWidget.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -193,6 +199,7 @@
193199
3B20A9AF2245228600E3D7AE /* CountlyPersistency.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyPersistency.m; sourceTree = "<group>"; };
194200
3B20A9B12245228700E3D7AE /* CountlyConsentManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyConsentManager.h; sourceTree = "<group>"; };
195201
4C3A4C9F2EB4C40000827FEA /* EventThreadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventThreadTests.swift; sourceTree = "<group>"; };
202+
96095A5E2F20105600FDE933 /* TouchDelegatingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TouchDelegatingView.h; sourceTree = "<group>"; };
196203
962485B92D9E971400FA3C20 /* TestUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = "<group>"; };
197204
96329DDF2D9426F300BFD641 /* CountlyServerConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountlyServerConfigTests.swift; sourceTree = "<group>"; };
198205
96329DE12D94299D00BFD641 /* ServerConfigBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerConfigBuilder.swift; sourceTree = "<group>"; };
@@ -202,10 +209,15 @@
202209
96681A9B2D97D9B300A4845A /* CountlyTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CountlyTests.xctestplan; sourceTree = "<group>"; };
203210
9673567E2EC60CD400C742D8 /* TestURLProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestURLProtocol.swift; sourceTree = "<group>"; };
204211
968426802BF2302C007B303E /* CountlyConnectionManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountlyConnectionManagerTests.swift; sourceTree = "<group>"; };
212+
9691B7642F1FA35500A6ADCB /* CountlyOverlayWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountlyOverlayWindow.h; sourceTree = "<group>"; };
213+
9691B7662F1FA35C00A6ADCB /* CountlyOverlayWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CountlyOverlayWindow.m; sourceTree = "<group>"; };
205214
969E5BCD2ECC4D2C00AB406A /* CountlyConsentManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountlyConsentManagerTests.swift; sourceTree = "<group>"; };
215+
96AAC9092F20B7790021CA5A /* TouchDelegatingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TouchDelegatingView.m; sourceTree = "<group>"; };
206216
96C05AAF2E8293630028A976 /* CountlyHealthTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountlyHealthTrackerTests.swift; sourceTree = "<group>"; };
207217
96DA74BA2D9FB687006FA6FF /* MockFeedbackWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockFeedbackWidget.swift; sourceTree = "<group>"; };
208218
96E680412BFF89AC0091E105 /* CountlyCrashReporterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountlyCrashReporterTests.swift; sourceTree = "<group>"; };
219+
96F80BE62F17D066006B4F71 /* CountlyWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountlyWebViewController.h; sourceTree = "<group>"; };
220+
96F80BE82F17D06F006B4F71 /* CountlyWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CountlyWebViewController.m; sourceTree = "<group>"; };
209221
D2193749248AC71C00E5798B /* CountlyPerformanceMonitoring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyPerformanceMonitoring.h; sourceTree = "<group>"; };
210222
D219374A248AC71C00E5798B /* CountlyPerformanceMonitoring.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountlyPerformanceMonitoring.m; sourceTree = "<group>"; };
211223
D249BF5C254D3D170058A6C2 /* CountlyFeedbackWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountlyFeedbackWidget.h; sourceTree = "<group>"; };
@@ -263,6 +275,12 @@
263275
3B20A9782245225A00E3D7AE = {
264276
isa = PBXGroup;
265277
children = (
278+
96AAC9092F20B7790021CA5A /* TouchDelegatingView.m */,
279+
96095A5E2F20105600FDE933 /* TouchDelegatingView.h */,
280+
9691B7662F1FA35C00A6ADCB /* CountlyOverlayWindow.m */,
281+
9691B7642F1FA35500A6ADCB /* CountlyOverlayWindow.h */,
282+
96F80BE82F17D06F006B4F71 /* CountlyWebViewController.m */,
283+
96F80BE62F17D066006B4F71 /* CountlyWebViewController.h */,
266284
96681A9B2D97D9B300A4845A /* CountlyTests.xctestplan */,
267285
39BDF7562CC7CA870066DE7C /* CountlyFeedbacks.h */,
268286
39BDF7582CC7CA920066DE7C /* CountlyFeedbacks.m */,
@@ -373,12 +391,14 @@
373391
39BDF7572CC7CA870066DE7C /* CountlyFeedbacks.h in Headers */,
374392
3B20A9D32245228700E3D7AE /* CountlyPushNotifications.h in Headers */,
375393
3B20A9C42245228700E3D7AE /* CountlyUserDetails.h in Headers */,
394+
96095A5F2F20105600FDE933 /* TouchDelegatingView.h in Headers */,
376395
965A2E9D2DDDCDAC00F28F6A /* CountlyHealthTracker.h in Headers */,
377396
3961C6B72C6633C000DD38BA /* PassThroughBackgroundView.h in Headers */,
378397
3B20A9CA2245228700E3D7AE /* CountlyConfig.h in Headers */,
379398
3B20A9872245225A00E3D7AE /* Countly.h in Headers */,
380399
1A423EA02A271FE0008C4757 /* CountlyRCData.h in Headers */,
381400
3B20A9C12245228700E3D7AE /* CountlyRemoteConfig.h in Headers */,
401+
96F80BE72F17D066006B4F71 /* CountlyWebViewController.h in Headers */,
382402
1A3110652A7128ED001CB507 /* CountlyViewData.h in Headers */,
383403
3B20A9B22245228700E3D7AE /* CountlyConnectionManager.h in Headers */,
384404
1A3A576529ED47BD0041B7BE /* CountlyServerConfig.h in Headers */,
@@ -391,6 +411,7 @@
391411
D219374B248AC71C00E5798B /* CountlyPerformanceMonitoring.h in Headers */,
392412
39911B672B457DBB00AC053C /* Resettable.h in Headers */,
393413
3B20A9BC2245228700E3D7AE /* CountlyCommon.h in Headers */,
414+
9691B7652F1FA35500A6ADCB /* CountlyOverlayWindow.h in Headers */,
394415
399117D42C69F73D00DC4C66 /* CountlyContentBuilder.h in Headers */,
395416
39527E182B5FD54C00EE5D7B /* CountlyAPMConfig.h in Headers */,
396417
3B20A9C52245228700E3D7AE /* CountlyCrashReporter.h in Headers */,
@@ -534,7 +555,12 @@
534555
isa = PBXSourcesBuildPhase;
535556
buildActionMask = 2147483647;
536557
files = (
558+
96AAC90A2F20B7790021CA5A /* TouchDelegatingView.m in Sources */,
537559
3B20A9B92245228700E3D7AE /* Countly.m in Sources */,
560+
3961C6B92C6633C000DD38BA /* PassThroughBackgroundView.m in Sources */,
561+
96F80BE92F17D06F006B4F71 /* CountlyWebViewController.m in Sources */,
562+
9691B7672F1FA35C00A6ADCB /* CountlyOverlayWindow.m in Sources */,
563+
3961C6BA2C6633C000DD38BA /* CountlyWebViewManager.m in Sources */,
538564
D249BF5F254D3D180058A6C2 /* CountlyFeedbackWidget.m in Sources */,
539565
3B20A9BA2245228700E3D7AE /* CountlyEvent.m in Sources */,
540566
3B20A9B52245228700E3D7AE /* CountlyCommon.m in Sources */,
@@ -547,7 +573,6 @@
547573
3948A8572BAC2E7D002D09AA /* CountlySDKLimitsConfig.m in Sources */,
548574
D2CFEF982545FBE80026B044 /* CountlyFeedbacksInternal.m in Sources */,
549575
1A3110632A7128CD001CB507 /* CountlyViewData.m in Sources */,
550-
3961C6B92C6633C000DD38BA /* PassThroughBackgroundView.m in Sources */,
551576
399117D32C69F73D00DC4C66 /* CountlyContentBuilderInternal.m in Sources */,
552577
39BDF7592CC7CA920066DE7C /* CountlyFeedbacks.m in Sources */,
553578
1A423E9E2A271E46008C4757 /* CountlyRCData.m in Sources */,
@@ -565,7 +590,6 @@
565590
3B20A9C92245228700E3D7AE /* CountlyUserDetails.m in Sources */,
566591
399117D12C69F73D00DC4C66 /* CountlyContentBuilder.m in Sources */,
567592
3B20A9D12245228700E3D7AE /* CountlyConfig.m in Sources */,
568-
3961C6BA2C6633C000DD38BA /* CountlyWebViewManager.m in Sources */,
569593
1A9027FE2AB197B50044EBCF /* CountlyExperimentInformation.m in Sources */,
570594
39924ED62BEBD20F00139F91 /* CountlyCrashData.m in Sources */,
571595
3B20A9C82245228700E3D7AE /* CountlyViewTrackingInternal.m in Sources */,

CountlyCommon.m

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -338,47 +338,50 @@ - (NSURLSession *)URLSession
338338
}
339339
}
340340

341-
- (CGSize)getWindowSize {
341+
#if (TARGET_OS_IOS)
342+
- (bool) hasTopNotch:(UIEdgeInsets)safeArea
343+
{
344+
return safeArea.top >= 44;
345+
}
346+
#endif
347+
348+
- (CGSize)getWindowSize{
342349
#if (TARGET_OS_IOS)
343350
UIWindow *window = nil;
344351

345352
if (@available(iOS 13.0, *)) {
346-
for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) {
353+
for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {
347354
if ([scene isKindOfClass:[UIWindowScene class]]) {
348355
window = ((UIWindowScene *)scene).windows.firstObject;
349356
break;
350357
}
351358
}
352359
} else {
353-
window = [[UIApplication sharedApplication].delegate window];
360+
window = UIApplication.sharedApplication.delegate.window;
354361
}
355362

356363
if (!window) return CGSizeZero;
357-
358-
UIEdgeInsets safeArea = UIEdgeInsetsZero;
359-
CGFloat screenScale = [UIScreen mainScreen].scale;
364+
365+
CGSize size = window.bounds.size;
366+
360367
if (@available(iOS 11.0, *)) {
361-
safeArea = window.safeAreaInsets;
362-
safeArea.left /= screenScale;
363-
safeArea.bottom /= screenScale;
364-
safeArea.right /= screenScale;
365-
}
366-
367-
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
368-
BOOL isLandscape = UIInterfaceOrientationIsLandscape(orientation);
369-
370-
CGSize size = CGSizeMake(window.bounds.size.width, window.bounds.size.height);
371-
372-
if(!isLandscape){
373-
size.width -= safeArea.left + safeArea.right;
374-
size.height -= safeArea.top + safeArea.bottom;
368+
UIEdgeInsets safeArea = window.safeAreaInsets;
369+
if([self hasTopNotch:safeArea] || CountlyContentBuilderInternal.sharedInstance.webViewDisplayOption == SAFE_AREA){
370+
size.height -= (safeArea.top); // always respect notch
371+
}
372+
if(CountlyContentBuilderInternal.sharedInstance.webViewDisplayOption == SAFE_AREA){
373+
size.height -= safeArea.bottom;
374+
}
375+
size.width -= MAX(safeArea.left, safeArea.right); // regardles of given safe area, act for cutout
375376
}
376377

377378
return size;
378-
#endif
379+
#else
379380
return CGSizeZero;
381+
#endif
380382
}
381383

384+
382385
@end
383386

384387

CountlyContentBuilderInternal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
1515
@property (nonatomic, strong) NSArray<NSString *> *currentTags;
1616
@property (nonatomic, assign) NSTimeInterval zoneTimerInterval;
1717
@property (nonatomic) ContentCallback contentCallback;
18+
@property (nonatomic, assign) WebViewDisplayOption webViewDisplayOption;
1819

1920
+ (instancetype)sharedInstance;
2021

CountlyContentConfig.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ typedef enum : NSUInteger
1515
CLOSED,
1616
} ContentStatus;
1717

18+
typedef enum: NSUInteger
19+
{
20+
IMMERSIVE,
21+
SAFE_AREA
22+
} WebViewDisplayOption;
23+
1824
typedef void (^ContentCallback)(ContentStatus contentStatus, NSDictionary<NSString *, id>* contentData);
1925
#endif
2026

@@ -46,6 +52,13 @@ typedef void (^ContentCallback)(ContentStatus contentStatus, NSDictionary<NSStri
4652
* Get zone timer interval
4753
*/
4854
- (NSUInteger) getZoneTimerInterval;
55+
56+
/**
57+
* To control how content and feedback widgets displayed. Default is IMMERSIVE (full screen contents)
58+
*/
59+
- (void) setWebviewDisplayOption:(WebViewDisplayOption) webViewDisplayOption;
60+
61+
- (WebViewDisplayOption)getWebViewDisplayOption;
4962
#endif
5063

5164
NS_ASSUME_NONNULL_END

CountlyContentConfig.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ @interface CountlyContentConfig ()
1010
#if (TARGET_OS_IOS)
1111
@property (nonatomic) ContentCallback contentCallback;
1212
@property (nonatomic) NSUInteger zoneTimerInterval;
13+
@property (nonatomic) WebViewDisplayOption webViewDisplayOption;
1314
#endif
1415
@end
1516

@@ -47,6 +48,16 @@ - (NSUInteger) getZoneTimerInterval
4748
{
4849
return _zoneTimerInterval;
4950
}
51+
52+
- (void)setWebviewDisplayOption:(WebViewDisplayOption)webViewDisplayOption
53+
{
54+
_webViewDisplayOption = webViewDisplayOption;
55+
}
56+
57+
- (WebViewDisplayOption)getWebViewDisplayOption;
58+
{
59+
return _webViewDisplayOption;
60+
}
5061
#endif
5162

5263
@end

CountlyFeedbackWidget.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,3 @@ - (NSString *)description
381381

382382
#endif
383383
@end
384-

CountlyOverlayWindow.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// CountlyOverlayWindow.h
2+
//
3+
// This code is provided under the MIT License.
4+
//
5+
// Please visit www.count.ly for more information.
6+
#if (TARGET_OS_IOS)
7+
#import <UIKit/UIKit.h>
8+
#endif
9+
10+
#import "CountlyCommon.h"
11+
12+
NS_ASSUME_NONNULL_BEGIN
13+
#if (TARGET_OS_IOS)
14+
@interface CountlyOverlayWindow : UIWindow
15+
@end
16+
#endif
17+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)