I'm developing an Android App that can send the user's current location via SMS.
For sending the SMS I use the following code:
String phoneNumber = "123456" //example
SmsManager smsManager = SmsManager.getDefault();
StringBuilder smsBody = new StringBuilder();
smsBody.append("This is my location:\n");
String uri = "http://maps.google.com/?q=loc:" + location.getLatitude()
+ "+" + location.getLongitude();
smsBody.append(uri);
smsManager.sendTextMessage(phoneNumber, null, smsBody.toString(),
null, null);
Now, when I send this to an Android device, I get a SMS with the link, and it opens perfectly in the native browser and in Google Chrome.
But, if I send it to an iPhone device - using the native browser (Safari) - it gives me an error that it cannot open the address because it is incorrect, but if I open it using Chrome (also on iPhone) - It works perfectly.
Has anyone got a clue why this is happening? Any workaround?
Here is an exact copy of the SMS message that is received:
This is my location: http://maps.google.com/?q=loc:32.05688742112759+34.899831548802496
Many thanks in advance!
EDIT:
Here is a screen capture of the error I'm getting when I try to open the link on an iPhone 4 running iOS7