Skip to content

Inserting to SIM card fails with NAME_EXCEEDED_MAX_CHAR_LIMIT #326

@Aroxed

Description

@Aroxed

Hi!
I'm trying to insert a contact into my SIM card. I've used such an approach as in the sample:

        val result = Contacts(context).sim().insertWithPermission().simContact { name="a1"; number="321" }.commitWithContext()

The result is:

SimContactsInsert.Result {
    isSuccessful: false
    failureReasons: {NewSimContact(name=a1, number=321, isRedacted=false)=NAME_EXCEEDED_MAX_CHAR_LIMIT}
    isRedacted: false
}

Also I ran the code according to the documentation:

        var insertResult: SimContactsInsert.Result;
            val newContact1 = NewSimContact(name = "abcdef", number = "1234567890")
            val newContact2 = NewSimContact(name = "abcdfb", number = "1234567890")
            val isSimCardReady = Contacts(this.applicationContext).sim().cardInfo.isReady // true
            insertResult = Contacts(this.applicationContext)
                .sim()
                .insert()
                .simContacts(newContact1, newContact2)
                .commit()

And the result is the same.
Could you tell me what I did wrong regarding NAME_EXCEEDED_MAX_CHAR_LIMIT?

I really appreciate any help you can provide.
Andrii.

Metadata

Metadata

Labels

questionFurther information is requested

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions