Merge branch 'master' into release-android-v2.3.0
This commit is contained in:
@@ -495,7 +495,9 @@ const NSTimeInterval MGLFlushInterval = 60;
|
||||
|
||||
MGLReachability *reachability = [MGLReachability reachabilityForLocalWiFi];
|
||||
[evt setValue:([reachability isReachableViaWiFi] ? @YES : @NO) forKey:@"wifi"];
|
||||
|
||||
|
||||
[evt setValue:[strongSelf applicationState] forKey:@"applicationState"];
|
||||
|
||||
[evt setValue:@([strongSelf contentSizeScale]) forKey:@"accessibilityFontScale"];
|
||||
|
||||
// Make Immutable Version
|
||||
@@ -653,6 +655,41 @@ const NSTimeInterval MGLFlushInterval = 60;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Can be called from any thread.
|
||||
//
|
||||
- (NSString *) applicationState {
|
||||
__block NSString *result;
|
||||
|
||||
NSString *(^applicationStateBlock)(void) = ^{
|
||||
switch ([UIApplication sharedApplication].applicationState) {
|
||||
case UIApplicationStateActive:
|
||||
result = @"Active";
|
||||
break;
|
||||
case UIApplicationStateInactive:
|
||||
result = @"Inactive";
|
||||
break;
|
||||
case UIApplicationStateBackground:
|
||||
result = @"Background";
|
||||
break;
|
||||
default:
|
||||
result = @"Default - Unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
if ( ! [[NSThread currentThread] isMainThread]) {
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
result = applicationStateBlock();
|
||||
});
|
||||
} else {
|
||||
result = applicationStateBlock();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Can be called from any thread.
|
||||
//
|
||||
- (NSInteger) contentSizeScale {
|
||||
|
||||
Reference in New Issue
Block a user