Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## XX.XX.XX
* Updated resolution extraction to accommodate iOS 26 deprecations.

## 25.4.6
* Added the ability to record reserved events.
* Changed default log level from "CLYInternalLogLevelDebug" to "CLYInternalLogLevelVerbose".
Expand Down
4 changes: 3 additions & 1 deletion CountlyCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ - (NSURLSession *)URLSession
- (CGSize)getWindowSize {
#if (TARGET_OS_IOS)
UIWindow *window = nil;
CGFloat screenScale;

if (@available(iOS 13.0, *)) {
for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) {
Expand All @@ -346,14 +347,15 @@ - (CGSize)getWindowSize {
break;
}
}
screenScale = window.traitCollection.displayScale;
} else {
window = [[UIApplication sharedApplication].delegate window];
screenScale = [UIScreen mainScreen].scale;
}

if (!window) return CGSizeZero;

UIEdgeInsets safeArea = UIEdgeInsetsZero;
CGFloat screenScale = [UIScreen mainScreen].scale;
if (@available(iOS 11.0, *)) {
safeArea = window.safeAreaInsets;
safeArea.left /= screenScale;
Expand Down
27 changes: 23 additions & 4 deletions CountlyDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,29 @@ + (NSString *)carrier

+ (NSString *)resolution
{
CGRect bounds;
CGFloat scale;
CGRect bounds = CGRectZero;
CGFloat scale = 0;
#if (TARGET_OS_IOS || TARGET_OS_TV)
bounds = UIScreen.mainScreen.bounds;
scale = UIScreen.mainScreen.scale;
UIWindow *window = nil;
#if (TARGET_OS_IOS)
if (@available(iOS 13.0, *)) {
#elif (TARGET_OS_TV)
if (@available(tvOS 13.0, *)) {
#endif
for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) {
if ([scene isKindOfClass:[UIWindowScene class]]) {
window = ((UIWindowScene *)scene).windows.firstObject;
break;
}
}
if(window){
bounds = window.bounds;
scale = window.traitCollection.displayScale;
}
} else {
bounds = UIScreen.mainScreen.bounds;
scale = UIScreen.mainScreen.scale;
}
#elif (TARGET_OS_WATCH)
bounds = WKInterfaceDevice.currentDevice.screenBounds;
scale = WKInterfaceDevice.currentDevice.screenScale;
Expand Down Expand Up @@ -519,3 +537,4 @@ - (void)resetInstance
}

@end

3 changes: 2 additions & 1 deletion CountlyFeedbacksInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ - (void)presentRatingWidgetInternal:(NSString *)widgetID closeButtonText:(NSStri
{
__block CLYInternalViewController* webVC = CLYInternalViewController.new;
webVC.view.backgroundColor = UIColor.whiteColor;
webVC.view.bounds = UIScreen.mainScreen.bounds;
CGSize windowSize = [CountlyCommon.sharedInstance getWindowSize];
webVC.view.bounds = CGRectMake(0, 0, windowSize.width, windowSize.height);
webVC.modalPresentationStyle = UIModalPresentationCustom;

WKWebView* webView = [WKWebView.alloc initWithFrame:webVC.view.bounds];
Expand Down