Skip to content

Commit 638f5c7

Browse files
authored
Add iPadOS as split out in Crashlytics Platform (#8006)
1 parent 090a372 commit 638f5c7

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

Crashlytics/Crashlytics/Components/FIRCLSApplication.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ NSString* FIRCLSApplicationGetSDKBundleID(void);
4747
*/
4848
NSString* FIRCLSApplicationGetPlatform(void);
4949

50+
/**
51+
* Returns the Operating System for filtering. Should be kept consistent with Analytics.
52+
*/
53+
NSString* FIRCLSApplicationGetFirebasePlatform(void);
54+
5055
/**
5156
* Returns the user-facing app name
5257
*/

Crashlytics/Crashlytics/Components/FIRCLSApplication.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#import "Crashlytics/Crashlytics/Components/FIRCLSHost.h"
1818
#import "Crashlytics/Crashlytics/Helpers/FIRCLSUtility.h"
1919

20+
#import <GoogleUtilities/GULAppEnvironmentUtil.h>
21+
2022
#if CLS_TARGET_OS_OSX
2123
#import <AppKit/AppKit.h>
2224
#endif
@@ -49,6 +51,19 @@
4951
#endif
5052
}
5153

54+
NSString* FIRCLSApplicationGetFirebasePlatform(void) {
55+
NSString* firebasePlatform = [GULAppEnvironmentUtil applePlatform];
56+
57+
#if TARGET_OS_IOS
58+
if ([firebasePlatform isEqualToString:@"ios"] &&
59+
UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
60+
return @"ipados";
61+
}
62+
#endif
63+
64+
return firebasePlatform;
65+
}
66+
5267
// these defaults match the FIRCLSInfoPlist helper in FIRCLSIDEFoundation
5368
NSString* FIRCLSApplicationGetBundleVersion(void) {
5469
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

Crashlytics/Crashlytics/Components/FIRCLSHost.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include "Crashlytics/Crashlytics/Helpers/FIRCLSUtility.h"
2626
#import "Crashlytics/Shared/FIRCLSFABHost.h"
2727

28-
#import <GoogleUtilities/GULAppEnvironmentUtil.h>
29-
3028
#if TARGET_OS_IPHONE
3129
#import <UIKit/UIKit.h>
3230
#else
@@ -161,7 +159,7 @@ static void FIRCLSHostWriteOSVersionInfo(FIRCLSFile* file) {
161159
[FIRCLSHostOSDisplayVersion() UTF8String]);
162160
FIRCLSFileWriteHashEntryString(file, "platform", [FIRCLSApplicationGetPlatform() UTF8String]);
163161
FIRCLSFileWriteHashEntryString(file, "firebase_platform",
164-
[[GULAppEnvironmentUtil applePlatform] UTF8String]);
162+
[FIRCLSApplicationGetFirebasePlatform() UTF8String]);
165163
}
166164

167165
bool FIRCLSHostRecord(FIRCLSFile* file) {

0 commit comments

Comments
 (0)