/// <summary> /// Tell Adjust that the application is activated (brought to foreground) or deactivated (sent to background). /// </summary> private static void VisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args) { if (firstVisibilityChanged) { firstVisibilityChanged = false; return; } if (args.Visible) { AdjustInstance.ApplicationActivated(); } else { AdjustInstance.ApplicationDeactivated(); } }
/// <summary> /// Tell Adjust that the application is deactivated (sent to background). /// /// This is used to calculate session attributes like session length and subsession count. /// This should only be used if the VisibilityChanged mechanism doesn't work /// </summary> public static void ApplicationDeactivated() { if (!_isApplicationActive) { return; } _isApplicationActive = false; AdjustInstance.ApplicationDeactivated(); }
/// <summary> /// Tell Adjust that the application is deactivated (sent to background). /// /// This is used to calculate session attributes like session length and subsession count. /// Call this in the Application_Deactivated method of your System.Windows.Application class. /// </summary> public static void ApplicationDeactivated() { AdjustInstance.ApplicationDeactivated(); }