mirror of
https://github.com/NohamR/Tweaks.git
synced 2026-08-26 10:12:32 +00:00
Add BGSessionFix tweak for simulator sessions
This commit is contained in:
16
BGSessionFix/Tweak.x
Normal file
16
BGSessionFix/Tweak.x
Normal file
@@ -0,0 +1,16 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
%hook NSURLSessionConfiguration
|
||||
|
||||
+ (NSURLSessionConfiguration *)backgroundSessionConfigurationWithIdentifier:(NSString *)identifier {
|
||||
NSLog(@"[BGSessionFix] Redirecting background session '%@' to a default (foreground) config", identifier);
|
||||
return [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
}
|
||||
|
||||
// // Deprecated pre-iOS8 entry point
|
||||
// + (NSURLSessionConfiguration *)backgroundSessionConfiguration:(NSString *)identifier {
|
||||
// NSLog(@"[BGSessionFix] backgroundSessionConfiguration:'%@' (deprecated API) -> forcing default config", identifier);
|
||||
// return [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
// }
|
||||
|
||||
%end
|
||||
Reference in New Issue
Block a user