Skip to content

Commit

Permalink
Add @available check for iOS 10 for opening URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
manavo committed Aug 2, 2021
1 parent df24ced commit 32722ce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Classes/DoorbellDialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,16 @@ - (void)goToDoorbell:(id)sender
{
NSString *doorbellURLWithUTM = [NSString stringWithFormat:DoorbellSite, self.appID];
NSURL *doorbellURL = [NSURL URLWithString:doorbellURLWithUTM];
[[UIApplication sharedApplication] openURL:doorbellURL options:@{} completionHandler:^(BOOL success) {
// if (success) {
// NSLog(@"Opened url");
// }
}];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:doorbellURL options:@{} completionHandler:^(BOOL success) {
// if (success) {
// NSLog(@"Opened url");
// }
}];
} else {
// Fallback on earlier versions
[[UIApplication sharedApplication] openURL:doorbellURL];
}
}

- (void)send:(id)sender
Expand Down
4 changes: 4 additions & 0 deletions DoorbelliOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.doorbell.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -356,6 +358,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.doorbell.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

0 comments on commit 32722ce

Please sign in to comment.