-
Notifications
You must be signed in to change notification settings - Fork 374
Open
Description
Xcode is producing many warnings re performance could be slow.
TSKBackgroundReporter.m
The else block below.
else {
// Get the vendor identifier
_appVendorId = identifier_for_vendor();
// We're not running unit tests - use a background session
// AppleDoc (currently 10.3) state that multiple background sessions with the same
// identifier should never be created, so ensure that cannot happen by creating
// a unique ID per instance.
NSString *backgroundSessionId = [NSString stringWithFormat:kTSKBackgroundSessionIdentifierFormat,
_appBundleId, [[NSUUID UUID] UUIDString]];
NSURLSessionConfiguration *backgroundConfiguration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:backgroundSessionId];
backgroundConfiguration.discretionary = YES;
backgroundConfiguration.sharedContainerIdentifier = sharedContainerIdentifier;
#if TARGET_OS_IPHONE
// iOS-only settings
// Do not wake up the App after completing the upload
backgroundConfiguration.sessionSendsLaunchEvents = NO;
#if !TARGET_OS_TV && !TARGET_OS_WATCH
// on iOS (but not tvOS or watchOS), enable multipath
backgroundConfiguration.multipathServiceType = NSURLSessionMultipathServiceTypeHandover;
#endif
#endif
// We have to use a delegate as background sessions can't use completion handlers
_backgroundSession = [NSURLSession sessionWithConfiguration:backgroundConfiguration
delegate:self
delegateQueue:nil];
}
This is the below 2 lines.
NSURLSessionConfiguration *backgroundConfiguration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:backgroundSessionId]
_backgroundSession = [NSURLSession sessionWithConfiguration:backgroundConfiguration
Metadata
Metadata
Assignees
Labels
No labels