can I add a custom URL to an ABPerson?

65 Views Asked by At

I have an app that will use the user's Contacts. One of my objects can contain a mailing address, so I thought I'd connect to an ABPerson in Contacts.

What I'd like to do is add a custom URL, one that would be understand my app, like:

mySpecialApp://12345

Then, in theory, if the user was in Contacts and viewed the address, and saw my URL, they could tap it, and it would launch my app. Is this even possible?

2

There are 2 best solutions below

0
On

Yes. Notice you can do this in the Contacts (or Phone) app: any person can have any number of URLs associated, each with its own descriptive label. "Home page" is the default, but you can enter any label and any URL. If the URL has a custom scheme, tapping it in Contacts will launch the app for that scheme.

The relevant constants for doing this in the AddressBook API can be found in the docs.

1
On

Yep, ios supports custom URL schemes. You would need to add it to your Info.plist file.

More detailed information here : http://www.idev101.com/code/Objective-C/custom_url_schemes.html