runtime
Package runtime is the Go API of the Drift permissions plugin (github.com/go-drift/drift/plugins/permissions/plugin in drift.yaml): permissions no other plugin provides, for apps whose own native code or SDKs use them.
import permissions "github.com/go-drift/drift/plugins/permissions/runtime"
go func() {
status, err := permissions.Contacts.Request(ctx)
...
}()
Each permission works only when its section is in the plugin's config; otherwise its calls fail with platform.ErrPermissionNotRegistered. Request waits for the user, so call it from a goroutine.
Variables
var (
// Contacts is read access to the user's contacts.
Contacts platform.Permission = configured{platform.NewPermission("contacts"), "contacts"}
// Calendar is read access to the user's calendar events (full access
// on iOS 17+; write-only access reads as PermissionLimited).
Calendar platform.Permission = configured{platform.NewPermission("calendar"), "calendar"}
// Microphone is microphone access.
Microphone platform.Permission = configured{platform.NewPermission("microphone"), "microphone"}
// Photos is read access to the photo library (selected photos on iOS
// read as PermissionLimited).
Photos platform.Permission = configured{platform.NewPermission("photos"), "photos"}
)
Generated by gomarkdoc