SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Nashville, TN
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iPhone handles street address in SMS message differently than Android

    My web site has a "Send Directions to My Phone" button. It takes the street address and emails it to the SMS gateway of the person's carrier (which they pick from a list). On Android, when the text message is received, the street address is recognized, underlined, and when pressed it asks with which program the user wants to display the address.

    On the iPhone, the text message is received, but is not automatically converted to a link. Our users have said they don't know how to copy the text to their map app.

    Is there a way to force iPhone to make the address into a link?

  2. #2
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,221
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    I don't know if this presentation will help you at all. It talks about the different ways of formatting links to launch different applications (one of them being the maps application)

    http://www.docstoc.com/docs/3595962/iPhone-URL-Scheme

    Also, this question in stackOverflow may be of help

    http://stackoverflow.com/questions/6...the-iphone-sdk

  3. #3
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Nashville, TN
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you molona. The first link you sent was exactly what I was looking for but could not find. Unfortunately when I formatted my text as specified in the document and sent it to SMS, the SMS reader on the iPhone still didn't make it clickable. Are any text messages on the iPhone ever clickable? Does that even happen?

    The second link seems to be describing the method I would use if I were writing my own SMS reader for iPhone, and I wanted it to parse links automatically.

    So, I am still looking for a solution. I would like to somehow send the address to an iPhone and have it be a clickable link to maps.

  4. #4
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Nashville, TN
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My friend showed me on his iPhone that if you go to Google Maps and choose "Share Location" and choose "MMS" then it will send an "MMS" message with a Contact file attached as a .vcf. I'm wondering if "MMS" is the same as "SMS"; if attaching a .vcf file to the email I'm sending to the provider will be attached to the text message; and if doing this will break Android, forcing me to ask the user what kind of phone they have. I'll be looking into these questions and if anyone knows already I'd love to hear about it.

  5. #5
    SitePoint Zealot
    Join Date
    May 2002
    Location
    Nashville, TN
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've gotten this to work. I had to UrlEncode the street address in my C# code.
    Code:
    string messageBody = string.Format("{0} " + "http://maps.google.com/maps?q=" + "{1}", LocationName, Server.UrlEncode(longAddress));
    
    Notice there's no HTML anchor tags or anything. The text application was able to recognize the URL, though.

    This worked! Thanks!

  6. #6
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,878
    Mentioned
    46 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by clay_mckinney View Post
    I've gotten this to work. I had to UrlEncode the street address in my C# code.
    Code:
    string messageBody = string.Format("{0} " + "http://maps.google.com/maps?q=" + "{1}", LocationName, Server.UrlEncode(longAddress));
    
    Notice there's no HTML anchor tags or anything. The text application was able to recognize the URL, though.

    This worked! Thanks!
    Just on a quick unrelated note. The biggest reason for string.Format() method is so that you do not need to contact strings. So you can replace:

    string.Format("{0} " + "http://maps.google.com/maps?q=" + "{1}", LocationName, Server.UrlEncode(longAddress));

    with

    string.Format("{0} http://maps.google.com/maps?q={1}", LocationName, Server.UrlEncode(longAddress));

    And that is the same thing, but easier to read


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •