-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Testing on emulator.
suspend fun createTemporalContact(temporalContact: NewTemporalContact): Boolean {
val rawContact: NewRawContact = NewRawContact().apply {
setName {
displayName = temporalContact.name
givenName = temporalContact.name
}
addPhone {
number = temporalContact.phone
}
}
val insertResult = contacts
.insertWithPermission()
.rawContact {
setName {
displayName = temporalContact.name
}
addPhone {
number = temporalContact.phone
}
}
.commit()
val contact = insertResult.contact(contacts, rawContact)
Log.i("AlormaContacts", "Contact: $contact") // <-- contact is NULL here
if (insertResult.isSuccessful && contact != null) {
val entity = TemporalContactEntity(
rawContactId = contact.id,
name = temporalContact.name,
phone = temporalContact.phone,
deleteAt = temporalContact.deleteAt,
)
temporalContactDao.insert(entity)
return true
}
return false
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels