-
Notifications
You must be signed in to change notification settings - Fork 191
User Deferrals
While the user deferrals feature was technically available in v1.0.0 of Nudge, it was only calculated per active Nudge session. After closing Nudge and re-opening, the deferral count would be reset to 0.
With v1.1.0 and higher, user deferrals are now saved and maintained across the entirety of a Nudge event.
Nudge saves the following keys in ~/Library/Preferences/com.github.macadmins.Nudge.plist
- deferRunUntil
- requiredMinimumOSVersion
- userDeferrals
- userQuitDeferrals
- userSessionDeferrals
When Nudge first opens up, it determines what Nudge event is configured for the and compares the requiredMinimumOSVersion
key of the JSON/mobileconfiguration against requiredMinimumOSVersion
key in NSUserDefaults.
If the value in your configuration is higher than the value in NSUserDefaults the following occurs:
- Log event:
New Nudge event detected - resetting all deferral values
- deferRunUntil key is deleted
- userDeferrals, userQuitDeferrals, userSessionDeferrals are reset to 0
There are two types of user deferrals: session deferrals and quit deferrals.
- Session deferrals are the amount of times Nudge was not the forefront application when the built-in nudge timer was passed.
- The count is saved to
userSessionDeferrals
- The count is saved to
- Quit deferrals are the amount of times Nudge was exited out by the user
- The count is saved to
userQuitDeferrals
- The count is saved to
Session and Quit deferrals values are combined for all Nudge logic and saved to userDeferrals
There are four buttons available to the user. The text is customizable following the updateElements key structure.
- primaryQuitButton - primaryQuitButtonText
- One Day - oneDayDeferralButtonText
- One Hour - oneHourDeferralButtonText
- Custom - customDeferralButtonText
It is very likely that your LaunchAgent timing will no longer occur when utilizing userQuitDeferrals
. For instance, if you have Nudge set to launch every 30 minutes, but a user has deferred for a day, you will lose up to 24 nudge events. If you do not want this behavior, it is recommended to disable user deferrals with the allowUserQuitDeferrals key.
When utilizing the Nudge Logging LaunchDaemon, the log events are always saved with the machine's local time, while Nudge calculates and saves all time via UTC (GMT timezone). This is a cosmetic issue.
If you are an admin and want to reset Nudge's user deferral behavior, simple run the following command via Terminal
defaults delete ~/Library/Preferences/com.github.macadmins.Nudge.plist