0

I have implemented a call functionality on button click. After that a popup appears with number as title and with options - cancel and Call. I want to show another controller with a message - call not placed if that cancel is clicked. Please help me to achieve this. Thanks in advance.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:8750509040"] options:@{} completionHandler:^(BOOL success) {
                                    if (success) {
                                        NSLog(@"Success");
                                    }
                                    else{
                                        NSLog(@"Failed");
                                    }
                                }];
TheTravloper
  • 236
  • 5
  • 16
  • 2
    Did you try this method: https://stackoverflow.com/questions/13743344/how-to-find-out-if-user-pressed-call-or-cancel-button-when-making-call-from-my-a – Dejan Skledar Jun 23 '18 at 07:44
  • But those methods can't specify about the cancel pressed @DejanSkledar – TheTravloper Jun 23 '18 at 07:51
  • 1
    Yes but they don't tells about cancel pressed @the4kman . They only implies the methods for call pressed. I want to do the things with cancel pressed – TheTravloper Jun 23 '18 at 07:54
  • you can't directly access what was pressed in the the system dialog. – Dejan Skledar Jun 23 '18 at 08:29
  • @Hemant You are right, the answers only talked about the Cancel button slightly. [I added an answer](https://stackoverflow.com/a/50999497/3151675) to the duplicate (written in Swift) that handles both buttons. – Tamás Sengel Jun 23 '18 at 08:47

0 Answers0