0

I am looking for a way of having a custom background for an incoming call using CallKit.

enter image description here

My app is a Voip app using Twillio. If the user had already received a call from a Twilio in the past, he is able to save this number (From call history), and the next time the contact will call, a custom background image will be displayed. But when saving the contact, the only information there is, is "social profile", no number. What is actually been saved? Is there a way of programmatically saving a contact from Twilio received with CallKit?

MCMatan
  • 8,623
  • 6
  • 46
  • 85
  • Are you receiving phone to app or app to app calls in your application? – philnash Jun 12 '17 at 11:22
  • @philnash thanks for your response, app to app. But I would not mind having a general contact for every income call, does not have to be specific per contact. – MCMatan Jun 12 '17 at 11:26

1 Answers1

0

Twilio developer evangelist here.

When you receive calls from another App using the Twilio Programmable Voice SDK you won't receive a phone number along with the call.

When calls are made app to app, you only need the identity of the other user that you are calling. No phone numbers are required to make this call.

Then, the TVOCall attributes from and to will be set to client:FROM_IDENTITY and client:TO_IDENTITY (where the identities are those from the users of your app).

If a call did come from a phone to the app, then the phone number would be included as the from attribute and you'd be able to save the contact with a phone number.

I'm not sure how to turn the information you do get with an app to app call into a proper contact though. Sorry.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • @phlinash Thank you for your details answer. I was aware of using Client identity for setting caller name. I am looking for a way of setting a different background image, for a better look and feel. I know true caller are doing something like this: https://stackoverflow.com/questions/43290574/custom-incoming-call-screen-like-truecaller-ios But they are using real numbers... anyway, If there would not be an any better answer (Meaning there is no answer) I will accept yours, thanks! (: – MCMatan Jun 12 '17 at 13:07
  • You could always try the same route as TrueCaller. Create a contact when you first run the app with your image and keep a record of that contact. Then, when the call comes in, update the contact with the call records you get from CallKit/Twilio. That might then cause the contact to appear as the incoming call. I don't know if it will work, but it's worth a try! – philnash Jun 12 '17 at 13:13
  • Wow, that sounds interesting! very cool, thank you! will do! (: – MCMatan Jun 12 '17 at 13:14