Contactlist actionlike buttons - iphone

Don't know on how to ask this in another way, so here it goes!
This is what I want;
When you view the details of a contact, you have the option of direct calling the phonenumber, send an email or lookup someones address within the Maps App of the iPhone.
I am also creating an App which shows some detailed information about a location.
The information shown in the detailed view:
Phonenumber (when choosing this it needs to call the number)
Emailaddress (when choosing this it needs to open the emailapp)
Address (When choosing this it needs to open the default MapApp of the iPhone)
Do I achieve this with actions which are available (somewhere)? If so, can anyone point me in the right direction?
I would help me alot!
With kind regards,
Douwe

iOS uses url schemes to allow communication between apps. You'd need to implement openURL:"yourformattedurlhere" in your button clicks with a properly formed URL to send data to the appropriate app.
You can check Apple's URL Scheme Reference for the details on the formatting.

Related

Send link (or other) such that form is already filled out

Is there a way to send some a url (or other thing) to a site such that data in a form is already filled out? This is not to my own site that I control.
For example, I want to send a link to some airline flights and want to have the destination and date be automatically filled out when the link is opened.
I'm guessing not, but have gotten lucky here before :) Maybe with some kind of program or add-on or??
If its written with GET method so just try to play with the site and just put the url with all the args you found.
If it is POST, so you need to create an add-on or pretend to a browser, search the net for this kind of solution.
No, that's not possible, if the remote site is not ready for that.

How to add user entered URLs?

I have a textField and textView that I need user entered URLs to be hyperlinked (I.E) when a user enters a website address it becomes clickable which takes you to that website, I have found plenty of articles on how to embed links just not on how to code for the user entered web addresses. (if it matters I'm using coreData) I have selected detect links in the xib but it that doesn't work. Any help with this would be greatly appreciated, thanks in advance
UITextView can only do that via data detectors and even there the links are the original text and you have no control over the user leaving the app.
The easiest method to get links fully under your control is to use the UI classes from DTCoreText. Those have buttons for the links which you can do anything you like with.
https://github.com/Cocoanetics/DTCoreText

Link directly to Google Maps transit directions mobile site

If you visit maps.google.com on a mobile device, then press 'Menu', 'Get Directions', and select the 'transit' option, you are taken to a page where you can enter two locations and a date/time, and get directions on public transit. However, the URL is still maps.google.com.
Is there any way to link directly to this page so that I can load it in a UIWebView in my iOS app? Would 'clicking' the buttons in Javascript be (the only/a good) solution?
Try: http://www.google.com/transit
Even clicking the buttons in javascript doesn't seem to be working. The Google Maps code is a little strange- the event listeners aren't assigned directly and I can't get a .click() to work. So what I'll do is have the user enter the two locations in boxes in the app, then load something like http://maps.google.com/maps?f=d&source=s_d&saddr=Coover+Hall&daddr=lied+rec+center in the UIWebView, except I'll add some more specific location information before building the URL, since this is a city-specific app. Not a perfect solution but it gets the job done.
You could create a URL that links to the transit directions with the "dirflg=r" paramater.
Find the other URL parameters here: http://web.archive.org/web/20110714031648/http://mapki.com/wiki/Google_Map_Parameters

embed iphone contact on page click link

my question is analogous to the "mailto:email#email.com" type of link but is more specifically:
if a phone number exists on a page and is viewed by a user on an iphone (phone number will appear as link), is there a way for that link to automatically (upon user clicking) ask the user if they want to add that number to the contact, and then auto fill certain details?
this seems a bit too amorphous to be obviously possible, but you never know.
Nope. Phone numbers will be recognized by Mobile Safari automatically, and be "forced" to be seen as telephone numbers by doing something like this:
555-1212
But you can't control the phone's behavior when the user taps the link. (Cool feature idea though. :) )
It think it's not necessary to use a tel: as a href protocol prefix. I am not sure if something like this validates or is somehow standard. There is also a skype href hack: href="skype:asdasdasd".
Alternative Solution
iOs also detects telephone numbers in text automagically. They just need the right format. See also here for formats: http://hjacob.com/blog/2009/07/making-a-phone-number-clickable-for-iphone-users/

iPhone file extension app association

On my iPhone, I'm running an app called Caissa Chess. After registering the app with the manufacturer (this is optional) I received an email, containing a chess puzzle. The crucial part of the mail message, showing a chess diagram looks like this:
<img src="cid:image1">
Tapping the diagram displayed by this URL quits Mail.app and opens Caissa Chess, that then displays the diagram, and allows you to solve the puzzle.
How does this work?I want to make a little app for the iPhone, that will need an external file, sent by email. I will fist need to understand what's going on.
chess:// how and where is defined what application will be opened?
what does the rest of the URL mean? Would it be referring to a local file, or will it be resolved by the app as a live http: url? The email message body contains an image attachment.
I'm sure that this mechanism is documented somewhere, but the books I have don't describe it, and Google didn't help me either.
Thank you in advance
Sjakelien
You have to register the protocol in your app. I've seen a few tutorials before, including this one.
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
It's called a URL protocol handler. This blog entry details how to implement it. Basically, you need to:
Register the protocol you want (like chess://). You can do this directly in the Info.plist file - check out the blog entry for more info.
Handle the request. For this, accept the application: handleOpenURL: message in your application delegate.