Skip to content

Commit 3630b4b

Browse files
authored
chore: Silence some iOS deprecation warnings (#1559)
1 parent ebdac1a commit 3630b4b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ -(NSString *)getMimeType:(NSURL *)url
221221

222222
NSString *type;
223223
[url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:nil];
224+
225+
#pragma clang diagnostic push
226+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
224227
return (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)type, kUTTagClassMIMEType);
228+
#pragma clang diagnostic pop
225229
}
226230

227231
- (nullable NSData *)readFromFileHandle:(NSFileHandle *)handle upTo:(NSUInteger)length error:(NSError **)err

CordovaLib/Classes/Public/CDVAppDelegate.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4040
return YES;
4141
}
4242

43+
#pragma clang diagnostic push
44+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
45+
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
4346
// this happens while we are running ( in the background, or from within our own app )
4447
// only valid if Info.plist specifies a protocol to handle
4548
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
@@ -64,12 +67,10 @@ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDiction
6467
[openURLData setValue:options[UIApplicationOpenURLOptionsAnnotationKey] forKey:@"annotation"];
6568
}
6669

67-
#pragma clang diagnostic push
68-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
6970
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:openURLData]];
70-
#pragma clang diagnostic pop
7171

7272
return YES;
7373
}
74+
#pragma clang diagnostic pop
7475

7576
@end

0 commit comments

Comments
 (0)