What is Developer Mode?

Developer Mode is a feature in TypingDNA Focus currently available on the MacOS version.

Developer Mode can be enabled via the more option menu in the TypingDNA Focus app.

Summary

Focus distributes system notifications through Apple’s DistributedNotificationSystem. Focus will distribute messages only if Developer Mode is set to ON.

The system will distribute a json file which contains the following:

The message is distributed every hour regardless of whether there is mood or typing data registered within Focus.

Activity Metrics

There are three activity metrics that are distributed within the hourly broadcast:

  • Minutes
    • Represents the amount of minutes spent typing on the keyboard
    • Value: between 0 and 60
  • Chars
    • Represents the amount of keys pressed
    • The app does not record the characters typed during logins
    • Value: between 0 and unlimited
  • Cpm
    • Represents the speed of typing
    • Values: {chars} / {minutes}

Mood Metrics

There are 6 mood metrics that are distributed within the hourly broadcast: focused; stressed; tired; happy; calm; energetic;

Each mood has values between: -100 and +100. The value “0” represents the “normal”/”baseline” of that user for each mood.

For more details about how moods are predicted and how values can be used for interpretation, please read this article.

Example

You can check out this demo on GitHub.

Add an observer

Declaration

func addObserver(forName name: NSNotification.Name?, 

          object obj: Any?, 

           queue: OperationQueue?, 

           using block: @escaping (Notification) -> Void) -> NSObjectProtocol

Parameters

name

The name of the notification to register for delivery to the observer block. Specify a notification name to deliver only entries with this notification name.

When nil, the sender doesn’t use notification names as criteria for delivery.

obj

The object that sends notifications to the observer block. Specify a sender to deliver only notifications from this sender.

When nil, the notification center doesn’t use the sender as criteria for the delivery.

queue

The operation queue where the block runs.

When nil, the block runs synchronously on the posting thread.

block

The block that executes when receiving a notification.

The notification center copies the block. The notification center strongly holds the copied block until you remove the observer registration.

The block takes one argument: the notification.

Return Value

An opaque object to act as the observer. Notification center strongly holds this return value until you remove the observer registration.

Remove an observer

 Declaration

- (void)removeObserver:(id)observer 

                  name:(NSNotificationName)aName 

                object:(NSString *)anObject;

Parameters

name

The name of the notification to register for delivery to the observer block. Specify a notification name to deliver only entries with this notification name.

When nil, the sender doesn’t use notification names as criteria for delivery.

obj

The object that sends notifications to the observer block. Specify a sender to deliver only notifications from this sender.

When nil, the notification center doesn’t use the sender as criteria for the delivery.

queue

The operation queue where the block runs.

When nil, the block runs synchronously on the posting thread.

block

The block that executes when receiving a notification.

The notification center copies the block. The notification center strongly holds the copied block until you remove the observer registration.

The block takes one argument: the notification.

Return Value

An opaque object to act as the observer. Notification center strongly holds this return value until you remove the observer registration.

Further Reading

For a more detailed description of Apple macOS’s DistributedNotificationSystem, please consult the documentation from Apple: