views:

105

answers:

3

hey all,
i have a very strange requirement...
i need to launch my app from let's say, a hyperlink that is received in an sms.
can this be done somehow?
i mean, the person who receives the sms simply taps on the link provided in the "special sms", and that launches the application
something like a special link which invokes the app in the device...

i have stumbled into an article that shows how message body can be created and sent programmatically in iOS4 and i think that might help me in the creation of the "special message"
So creation of the message may not be an issue here... :|
It's the invocation part...
Anybody knows what can be done???
Suggestions and sample codes greatly appreciated... :)
Thanks in advance!

+2  A: 

Hi,

Good news, it is possible and quite simple (really easy in fact)

Take a look at this tutorial

Update : it seems that the SMS app doesn't auto recognize that address type

F.Santoni
Woah! thanks! looks like its the stuff i need... I'll try it out. Thanks again! :))
Bangdel
Hey! thankx! this works really great... I was able to do the 'launch an app from another app' thing... But the tragedy of the situation is that I am unable to launch it from the SMS... IF I have used the URL scheme as myApp, then typing "<myApp://something>" in the compose message should automatically detect it and make it clickable right? Well this is where its not working... Please help :(
Bangdel
@santoni: I read your update... :(( So what do i do to fix it? do i change the address type or something????? Help! And check this out- http://stackoverflow.com/questions/625232/launching-application-from-a-sms-message . Someone has been successful in launching app from SMS it seems. I wonder how...
Bangdel
Maybe Apple changed something or in the thread they didn't really test.. I tested on iPhone 4, I'll test on our 3GS
F.Santoni
On 3GS (iOS 3.1.2) it failed
F.Santoni
@santoni: thanks for your support :) Its a tragedy that it failed in iOS 3.1.2 because that's what I was using too. And you said you tried in iPhone 4..did it work in that???
Bangdel
It failed on both iPhone 3GS and 4.
F.Santoni
Looks like the SMS App no longer recognizes the URL scheme for the installed Apps. One workaround (uncool though) is to send a mail instead of the sms; containing the URL scheme as a hyperlink text. In the mail application, this becomes clickable and launches the app when the user taps on it.
Bangdel
+1  A: 

What you need to do is get your app to respond to a custom URL sequence, such as myApp://open

Apple has documentation on this:

http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/StandardBehaviors/StandardBehaviors.html#//apple_ref/doc/uid/TP40007072-CH4-SW50

if you need more help, please ask.

This will also work with mail and webpages, anywhere you can put a clickable link...

Tom H
Thanks for the reply :)) I'll got through the doc.. And I'm sure that as i progress into the creation of this app, i'll be stumbling into a lot of things where i'll be crying out "Help!". Sure, I'll be asking you then ^___^ thanks again!
Bangdel
"Help!" Well in my app I also need to pass parameters to the app via the url...So any idea what the URL scheme will look like? :P
Bangdel
Look at the tutorial from my response you can handle myapp://whatyourwant and then when the app is launched you can check the URL and do what you want :)
F.Santoni
Help! I gave the URL Scheme as: simpleApplication and the URL Identifier as : com.company.simpleApplication. I did as told in the tutorial. I tried :1. "simpleApplication"2. "<simpleApplication>"3. "simpleApplication://"4. "<simpleApplication://>"5. <simpleApplication>6. <simpleApplication://>in the compose message and after all these permutations, still the URL is not being identified and the App is not getting launched!Please tell me where did i go wrong...i'm desperate :((HELP!!!
Bangdel
A: 

"<simpleApplication://>" should work for u...!!!

kool4u