Returns a list of all contacts stored on the device.

Usage #

package main

import (
    "fmt"
    t "github.com/hugmouse/gotermux"
)

func main() {
    contacts := t.TermuxContactList()
    
    for _, contact := range contacts {
        fmt.Printf("Name: %s\n", contact.Name)
        fmt.Printf("Phone: %s\n", contact.Number)
        fmt.Println("---")
    }
}

Output: Name: John Doe Phone: +1234567890 #

Name: Jane Smith Phone: +9876543210 #

Return Value #

Returns []TContact - array of contact information.

Struct TContact #

FieldTypeDescription
NamestringContact display name
NumberstringPhone number
EmailstringEmail address
Accessing contacts requires the READ_CONTACTS permission. The device may prompt for this permission when first used.