Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 7c65935

Browse files
authored
Add Xcode7 workaround for failing dynamic check in Xcode 7/sdk version 9. (#24)
1 parent 4df802b commit 7c65935

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

packages/url-launcher/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.3.5] - 2017-05-8
2+
3+
* Workaround for failing dynamic check in Xcode 7/sdk version 9.
4+
15
## [0.3.4] - 2017-05-08
26

37
* Add test.

packages/url-launcher/ios/Classes/UrlLauncherPlugin.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,18 @@ - (BOOL)canLaunchURL:(NSString*)urlString {
3535
}
3636

3737
- (void)launchURL:(NSString*)urlString result:(FlutterResult)result {
38-
NSURL* url = [NSURL URLWithString:urlString];
39-
UIApplication* application = [UIApplication sharedApplication];
40-
if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {
41-
// iOS 10 and above
38+
NSURL* url = [NSURL URLWithString:urlString];
39+
UIApplication* application = [UIApplication sharedApplication];
40+
41+
// Using ifdef as workaround to support running with Xcode 7.0 and sdk version 9
42+
// where the dynamic check fails.
43+
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0
4244
[application openURL:url options:@{} completionHandler: ^(BOOL success) {
4345
[self sendResult:success result:result url:url];
4446
}];
45-
} else {
47+
#else
4648
[self sendResult:[application openURL:url] result:result url:url];
47-
}
49+
#endif
4850
}
4951

5052
- (void)sendResult:(BOOL)success result:(FlutterResult)result url:(NSURL*)url {

packages/url-launcher/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: url_launcher
22

3-
version: 0.3.4
3+
version: 0.3.5
44
description: A Flutter plugin for launching a URL
55
author: Flutter Team <[email protected]>
66
homepage: https://github.com/flutter/plugins

0 commit comments

Comments
 (0)