diff --git a/notifier/cmd_dm.go b/notifier/cmd_dm.go index 9998057..a54c896 100644 --- a/notifier/cmd_dm.go +++ b/notifier/cmd_dm.go @@ -19,6 +19,9 @@ type DeclarativeManagementCommand struct { } // NewDeclarativeManagementCommand creates a new "DeclarativeManagement" Apple MDM command. -func NewDeclarativeManagementCommand() *DeclarativeManagementCommand { - return &DeclarativeManagementCommand{Command: DeclarativeManagementPayload{RequestType: DeclarativeManagementRequestType}} +func NewDeclarativeManagementCommand(uuid string) *DeclarativeManagementCommand { + return &DeclarativeManagementCommand{ + Command: DeclarativeManagementPayload{RequestType: DeclarativeManagementRequestType}, + CommandUUID: uuid, + } } diff --git a/notifier/enqueue.go b/notifier/enqueue.go index 522a34f..93d4438 100644 --- a/notifier/enqueue.go +++ b/notifier/enqueue.go @@ -57,8 +57,7 @@ func (n *Notifier) sendCommand(ctx context.Context, ids []string) error { } } - c := NewDeclarativeManagementCommand() - c.CommandUUID = uuid.NewString() + c := NewDeclarativeManagementCommand(uuid.NewString()) if len(tokens) > 0 { c.Command.Data = &tokens }