Search code examples
iosios9telephonyincoming-call

How to achieve a "contact" button on incoming call screen


Recently I installed an app named "Ringo" What they are doing is a different thing. But I got amazed by seeing a "contact" button when they call your phone. Please see attached screenshot.

They basically create a contact in my address book with an image and when they call my phone number using one of added number I got this screen, This screen is different then usual contact incoming call screen. If I set an image for a contact I get a full screen image of that contact when they call me. Name is center aligned and there is no button to go to that contact.

I am looking to achieve the same thing. Is this some kind of setting when adding the contact in address book? or this is some kind of trick.

enter image description here


Solution

  • There are actually two types of images that can be associated with a contact:

    • a "large" image, that can only be set on the device itself, and is supposedly not synced via iCloud. Programmatically, this would be manipulated via ABPersonSetImageData

    • smaller "photo" and "logo" images, which may be included in a vCard (see PHOTO and LOGO in https://en.wikipedia.org/wiki/VCard#Properties).

    I believe the former is displayed full screen, while the latter (or maybe only one of the two) is displayed as the smaller icon top right.

    I haven't found a direct way to set those, but you may be able to generate a vCard and pass it to ABPersonCreatePeopleInSourceWithVCardRepresentation. You'll have to include either an URL or a base-64 representation of the image.

    Alternatively, it may be just based on the size of the picture, though I don't know what the exact threshold would be, taking into account Retina sizes etc.