결함 #14019
[3T][Talk][#20983][MO] Kolon Talk_연락처가 2개 이상 등록되어 있는 내역 전달 시 AOS/IOS 동작이 상이함
100%
설명
[재현경로]
대화방 > + 버튼 선택 > 2개 이상 등록된 연락처 선택 > 전송
[문제점]
연락처가 2개 이상 등록되어 있는 내역 전달 시 AOS/IOS 동작이 상이함
AOS의 경우 연락처를 선택 할 수 있는 팝업이 노출되나 실제 선택한 연락처가 전송되지는 않음
IOS의 경우 연락처를 선택 할 수 있는 팝업이 노출되지 않음
[기대결과]
연락처를 선택하여 전달이 가능 할 시 해당 팝업이 둘 다 노출되어야 함 (선택 전달이 아닌 경우 AOS에서도 선택 불가해야 함)
연결된 일감
이력
#3 조정후이(가) 10일 전에 변경
--------------- iOS 의 경우 ---------------
* 연락처 선택하여 보낼때 : 선택된 아이폰 연락처정보 전체를 VCard로 변환하여 전송함.
func contactPicker(_ picker: CNContactPickerViewController, didSelect contact: CNContact) {
Log("didSelect contact : (contact)")
if let data = try? CNContactVCardSerialization.data(with: [contact]) {
if let vcardstring = String(data: data, encoding: .utf8) {
guard let chatRoom = self.chatRoom else {
return
}
ContentsManager.shared.sendMessage(.contact, text: vcardstring, contactDisplayName: contact.familyName + contact.givenName, roomId: chatRoom.id)
}
}
}
대화방에서 연락처를 보여줄때 휴대번호의 첫 번호를 취해 보여줌.
case .contact:
// 연락처뷰 추가 후 변경.
if let data = message.content.data(using: .utf8) {
if let contacts = try? CNContactVCardSerialization.contacts(with: data), let contact = contacts.first {
vcardImageView.contentMode = .scaleAspectFill
if let imageData = contact.imageData, contact.imageDataAvailable {
vcardImageView.image = UIImage(data: imageData)
} else {
vcardImageView.image = UIImage(named: "profilePhotoNone")
}
vcardNameLabl.text = "(contact.familyName)(contact.givenName)"var description: String = "" if contact.phoneNumbers.count > 0 { for number in contact.phoneNumbers { if number.label == "_$!<Mobile>!$_" { description.append(contentsOf: number.value.stringValue) break } } if description == "" { if let number = contact.phoneNumbers.first?.value.stringValue { description = number } } } if let email = contact.emailAddresses.first?.value { description.append(contentsOf: "\n") description.append(contentsOf: email as String) } vcardContentLabel.text = description vcardContentLabel.setLineSpacing(lineSpacing: 7, alignment: .left) }
#4 정도영이(가) 10일 전에 변경
- 상태을(를) 신규에서 진행(으)로 변경되었습니다.
- 진척도을(를) 0에서 80(으)로 변경되었습니다.
안드로이드 현상 :
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Phone.CONTENT_URI) 로
요청시 여러 전화번호가 등록된 사용자를 선택하면,
data.getData()로 반환된 URI (예: content://com.android.contacts/data/3288....)를 query()했을 때
해당 사용자의 모든 전화번호가 포함되어 반환이 되고 있음
이는 ContactsContract.CommonDataKinds.Phone.CONTENT_URI가
내부적으로 ContactsContract.Data 테이블을 참조하고,
동일한 contact_id를 가진 여러 전화번호 행을 함께 매핑하기 때문임
따라서 사용자가 실제로 어떤 번호를 선택했는지 식별이 불가능하며,
vCard에는 사용자 등록 전화번호가 모두 표시됨
예시:
BEGIN:VCARD
VERSION:2.1
N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:;김선영;;;
FN;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:김선영
TEL;CELL;PREF:01020878341
TEL;WORK:0212628855
END:VCARD
수정 사항 :
해결을 위해 Intent 대상을 전화번호 단위(Phone.CONTENT_URI)가 아닌
연락처 단위(Contacts.CONTENT_URI)로 변경했습니다:
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
이 방식은 전화번호 선택 팝업 없이 한 명의 연락처만 선택하도록 하며,
lookupContact()를 통해 contactId를 얻어 필요한 데이터를 처리하여 iOS와 동일하게 수정함.