IPhone: automatically launch applications?

Discussion in 'iPhone/iPad Programming' started by kingkung, Mar 31, 2008.

  1. macrumors newbie

    #1
    Hi,

    I'm using the iPhone SDK, and I want my iPhone application to automatically launch at a certain time... any way I can do this?

    And any way I can test this on the emulator?
     
  2. macrumors 68040

    #2
    I am almost certain that there is no officially supported way to do this.
     
  3. macrumors newbie

    #3
    Thanks for the quick response.

    Can you clarify what you mean by "official"? Are there certain "unofficial" ways to do this?

    Follow up question: Are there any other ways to start up an application on the phone? For example, via system events, like adding a contact or photo? Or via a port-directed SMS?
     
  4. macrumors G5

    gnasher729

    #4
    Yes. Just watch the iPhone videos on ADC; one of them shows the official way to start an application either by using a link on a website, or from another application.
     
  5. macrumors newbie

    #5
    Sweet, thanks a lot. I have the ADC videos downloaded, do you happen to recall in which video they discuss this? I assume it's the "iPhone SDK for Web Developers" video...
     
  6. macrumors newbie

    #6
    Never mind, I found it, thanks.
     
  7. macrumors newbie

    #7
    Okay, I just watched the video, which told me to create a URL schema for the app (myapp://).

    Am I wrong in assuming that this feature will only work when I access the web link on my own iPhone (and not on any public domain)? I assume this is the case since no public computer would know to send links beginning with "myapp://..." to my iPhone app.

    Thanks for the help.
     
  8. macrumors regular

    #8
    Well I highly doubt you will ever be allowed to launch an app on your phone that in response to a message that originates outside your phone. That would just beg for invasive hacking.
     
  9. macrumors demi-god

    #9
    My understanding is that you register yourapp:// with Apple and they'll make Safari compatible with it, just like maps://whatever will open Google Maps, etc. So if you're making a cook book app and you register cookbook://blahblah with Apple, if anyone visits any website with a link cookbook://texthere it'll open up your cook book app on their phone, assuming they have it installed.

    As for launching at a specific time, no, because that would require your app to run as a background process, which is against the rules. Of course if you jailbreak and write an unofficial app you can do this.
     
  10. macrumors regular

    #10
    That isn't how it works. You make your app register for a certain type of url, i.e myapp://. You can then embed a link in a page using this protocol. When selected in Safari on the phone, the link will be forwarded on to your app which will handle the request. There is no registration by Apple involved.
     
  11. macrumors member

    #11
    fThis is Apple's tutorial on how to register for a your URL type(you'll have to be logged into ADC to get to it).
    http://developer.apple.com/iphone/library/samplecode/LaunchMe/index.html
    You certainly can use these links outside of Safari, look at the Address Book application. Each one of those UITableViewCells is a link(like the phone number cell links to tel://5555555555).
     
  12. macrumors 6502

    Monkaaay

    #12
    It would be nice to be able to launch applications on start up. Too bad I never see it happening.
     
  13. macrumors newbie

    #13
    Does anyone know a way to have a program or link start an application and then stop it after a period of time?
     
  14. macrumors regular

    #14
    The receiving app can do what it needs to needs to do, and then open another registered url scheme back to the originating app.

    App 1 opens "app2://dosomething/"
    App 2 does something which takes a minute
    App 2 opens "app1://didsomething/"
     
  15. macrumors newbie

    #15
    Hi,

    I'm looking for a way to write a method, or perhaps a link in a UIWebView, that will cause my app to close, and the iPhone's Camera app to open. Is there a way to do that? I explored LaunchMe, but it seems I'm trying to do something different.

    Thanks,
    /Steve
     
  16. macrumors regular

    #16
    This isn't what you want to do. Instead, use the UIImagePickerController class to open the camera library or camera view from within your own app.
     
  17. macrumors newbie

    #17
    Hi, SqueegyX,

    Thanks for responding. I've already programmed to be able to use the camera from within my app, but I was considering just sending people over to the Camera app, because launching the camera from within your app takes mucho memory.

    But I think I'll just keep using the camera within my app. Thanks anyway!
    /Steve
     
  18. macrumors newbie

    #18
    I want to have my web app launch Mail and take you to your inbox... How would I do this with a link? I presume it would be mail:// but what would I put after that?
     
  19. macrumors regular

    #19
    Don't you can quite do that. The closest you will get it to open a mailto:foo@bar.com url. That will open the mail app with a new message prepped for sending to that address.
     
  20. macrumors newbie

    #20
    Can you have an application launch itself and then close like 5 seconds later? There are apps that send you reminders at a certain time, why would I not be able to do that?
     
  21. macrumors newbie

    #21
    Sorry to change the subject (slightly), but I have a question along the same lines as this...

    From what I have read so far there is not a way to launch an app at a certain time (ie: an alarm clock programmed to open a radio app), but is there a way to launch a link to an online audio feed?

    Basically, I would like my iPhone to wake me with a certain radio station (for which I have an app and the direct link to the audio feed) and I live too far away to use a regular alarm clock for that. Am I asking for the impossible, or is there something I have overlooked?
     

Share This Page