Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions TTOpenInAppActivity/TTOpenInAppActivity.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,22 @@ - (void)openDocumentInteractionControllerWithFileURL:(NSURL *)fileURL
NSString *message = [NSString stringWithFormat:NSLocalizedStringFromTableInBundle(@"Your %@ doesn't seem to have any other Apps installed that can open this document.", @"TTOpenInAppActivityLocalizable", [TTOpenInAppActivity bundle], nil), deviceType];

// Display alert
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedStringFromTableInBundle(@"No suitable App installed", @"TTOpenInAppActivityLocalizable", [TTOpenInAppActivity bundle], nil)
message:message
delegate:nil
cancelButtonTitle:NSLocalizedStringFromTableInBundle(@"OK", @"TTOpenInAppActivityLocalizable", [TTOpenInAppActivity bundle], nil)
otherButtonTitles:nil];
[alert show];
// #available(iOS 9.0, *)
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0){
UIAlertController* alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"No suitable App installed", nil)
message:message
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {}];
[alert addAction:cancelAction];
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alert animated:YES completion:nil];
}else{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedStringFromTableInBundle(@"No suitable App installed", @"TTOpenInAppActivityLocalizable", [TTOpenInAppActivity bundle], nil)
message:message
delegate:nil
cancelButtonTitle:NSLocalizedStringFromTableInBundle(@"OK", @"TTOpenInAppActivityLocalizable", [TTOpenInAppActivity bundle], nil)
otherButtonTitles:nil];
[alert show];
}

// Inform app that the activity has finished
// Return NO because the service was canceled and did not finish because of an error.
Expand Down