How to connect the app to telephone

Discussion in 'iPhone/iPad Programming' started by serkan, Dec 6, 2012.

  1. macrumors regular

    serkan

    Joined:
    May 14, 2012
    Location:
    Turkey
    #1
    Hello there programmers :)

    I am really new and into this business with a friend of mine and we would like to publish an app together with him.It will be a very basic one and easy to use.But there is one problem that I couldnt solve.We would like to connect the app to the phone.I mean in the app when the client hits the name tag it will automaticly switches to the phone and dials that number and calls it.It must be easy as like, the client of the app have to click the name and put the phone into his ear and talk.How can we do this ? Any ideas ?

    It could sound really stupid question but I hope we will get a good begginers answer :D

    P.S : My friend know some C and C++ will it bwe helpfull for us to create a basic app ?

    Thanx all :)
     
  2. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    There is a telephone link in the Xcode SDK (Cocoa Touch API).
    In about 4 seconds of google search, you get this ->
    Code:
    -(IBAction)callPhone:(id)sender {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:2135554321"]];
    }
    It will open the tel: scheme -> including the number, so it just has to press the button and it will call it :)
     
  3. thread starter macrumors regular

    serkan

    Joined:
    May 14, 2012
    Location:
    Turkey
    #3
    Thanx a lot :)
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Just to be clear, jnoxx's solution only brings up the call interface with the number filled-in; the user must still press a button to make the actual call. There is no way with the iOS SDK to have an app call automatically.
     
  5. macrumors 6502

    Joined:
    Jun 17, 2007
    #5
    I don't think that's correct. I'm using it in one of my apps and it does actually initiate the call, with no user confirmation required.
     
  6. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Well, I'll be damned. You're right! Maybe they've changed that since I last remember trying it. Anyways, good news for the OP!
     
  7. macrumors 603

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #7
    As a user, that sounds like an issue to me. Actions like calling shouldn't be possible with a single accidental tap.
     
  8. thread starter macrumors regular

    serkan

    Joined:
    May 14, 2012
    Location:
    Turkey
    #8
    Actually its not going to be a accidental tap.You have to open the program first and then you should choose and call.Actually the program will be based on calling so the person who opens the program will open it to call :) So no accidental D: I am sorry that I dont tell the app :) When it comes out I hope you will see it and use it then you ll understand why I say its not accidental :D
     
  9. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #9
    You're not making an app that's equivalent to the Favorites tab of the built-in Phone app, are you?
     
  10. thread starter macrumors regular

    serkan

    Joined:
    May 14, 2012
    Location:
    Turkey
    #10

    Nope sir :)

    It's a secret :D

    I live in Turkey and the app that I will make is really important for our country but I dont know will it be that important for other countries.First I will publish it for Turkish Apple Store and further more I do researches I will publish it for other countries as well :)
     
  11. macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #11
    I think they changed that in iOS 6, and I also think there is a difference between a NEW number or one that's in your contacts library, but I can't confirm 100% So this aint legit :p
     

Share This Page