Discussion Forums  >  Uncategorized

Replies: 2    Views: 130

Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
01/12/12 01:08 PM (13 years ago)

Is it possible to turn on the Place Call Confirmation feature like in previous versions of BT?

I know this feature was removed awhile ago, but I need to have the ability to enable it again. I'm making an app that has a button that dials 911 and I can't have it dial automatically or users will dial 911 by accident. I liked this feature a lot when it was still available in previous version of Buzztouch source code. Below is the change log info from when it was removed. Hopefully there is a way to reverse it. I still have copies of old source code when it still worked maybe some can direct me to the code I need to copy into my current project to enable this feature again. 08-19-2011: Place Call Confirmation removed. The Call Us feature was asking the user to confirm that they wanted to place a phone call before launching the dialer app. Confirmation is no longer required and the app attempts launches the dialer directly. Note: The device itself may ask the user to confirm this operation, app owners cannot control this behavior.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/12/12 01:32 PM (13 years ago)
Possible work around: Have button linked to screen with confirm button. It be nice to require user to draw symbol check to prevent calling when walking. But if it's a true emergency how many hoops do you want to require.
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
01/13/12 12:29 PM (13 years ago)
In case anyone wants to know how to turn on the old style Buzztouch call confirmation here is how I did it. In the BT_viewControllerManager.m I replaced the code //Place Call code with this: NOTE the two place that say YOUR APP NAME replace this with YOUR APP NAME. ////////////////////////////////////////////////////////////////////////////////////////////////// //place call displys an action sheet +(void)placeCallWithScreenData:(BT_item *)theScreenData{ [BT_debugger showIt:self:[NSString stringWithFormat:@placeCallWithScreenData nickname: \%@\ itemId: %@ itemType: %@, [theScreenData itemNickname], [theScreenData itemId], [theScreenData itemType]]]; //WE WILL NOT BE HERE IF THE DEVICE IS NOT CAPABLE OF MAKING CALLS //appDelegate YOUR APP NAME_appDelegate *appDelegate = (YOUR APP NAME_appDelegate *)[[UIApplication sharedApplication] delegate]; if([appDelegate.rootApp.rootDevice canMakePhoneCalls] == TRUE){ //the number NSString *number = [BT_strings getJsonPropertyValue:theScreenData.jsonVars:@number:@]; //dictionary of screen options NSString *callLabel = [NSString stringWithFormat:@%@ %@, NSLocalizedString(@callTitle, Call), number]; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@callMessage, Would you like to make a phone call?) delegate:self cancelButtonTitle:nil destructiveButtonTitle:NSLocalizedString(@callCancel, Do Not Call) otherButtonTitles:callLabel, nil]; [actionSheet setTag:99]; [actionSheet setActionSheetStyle:UIActionSheetStyleBlackOpaque]; //how we display the action sheet depends on layout //is this a tabbed app? if([appDelegate.rootApp.tabs count] > 0){ [actionSheet showFromTabBar:[appDelegate.rootApp.rootTabBarController tabBar]]; }else{ //theNavController = [appDelegate.rootApp rootNavController]; [actionSheet showInView:[appDelegate.rootApp.rootNavController view]]; } [actionSheet release]; }else{ //show alert... UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@callsNotSupportedTitle, Calls Not Supported) message:NSLocalizedString(@callsNotSupportedMessage, You need to be using an iPhone to make phone calls) delegate:self cancelButtonTitle:NSLocalizedString(@ok, OK) otherButtonTitles:nil]; [alert show]; [alert release]; } } ////////////////////////////////////////////////////////////////////////////////////////////////// //action sheet delegate methods (action sheet is displayed for confirmations) //action sheet for call-us button click confirmation +(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { [BT_debugger showIt:self:[NSString stringWithFormat:@actionSheet:clickedButtonAtIndex: %i, buttonIndex]]; IMPORTANT. Numbers should not contain parenthesis, dashes are better. Exmaple: 123-123-1234 is better than (123)123-1234 Not sure why but crazy results happen sometimes? */ //place phone call prompts have tag == 99 int theTag = actionSheet.tag; NSString *numberToCall = [NSString stringWithFormat:@tel:%@, [actionSheet buttonTitleAtIndex:[actionSheet firstOtherButtonIndex]]]; //remove the word call (or whatever it is in current language) from number so the dialer works. NSString *callLabel = NSLocalizedString(@callTitle, Call); numberToCall = [numberToCall stringByReplacingOccurrencesOfString:callLabel withString:@]; numberToCall = [numberToCall stringByReplacingOccurrencesOfString:@ withString:@]; if(theTag == 99){ if(buttonIndex == 1){ [BT_debugger showIt:self:[NSString stringWithFormat:@launching dialer: %@, numberToCall]]; if([numberToCall length] > 5){ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:numberToCall]]; } }else{ //cancel clicked, do nothing } } } //////////////////////////////////////////////////////////////////////////////////////////////////
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.