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("---")
}
}
Return Value #
Returns []TContact
- array of contact information.
Struct TContact #
Field | Type | Description |
---|---|---|
Name | string | Contact display name |
Number | string | Phone number |
Email | string | Email address |
Accessing contacts requires the READ_CONTACTS permission. The device may prompt for this permission when first used.