Version: 2021.3
LanguageEnglish
  • C#

AnalyticsSessionInfo.sessionFirstRun

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static bool sessionFirstRun;

Description

Indicates whether the current session is the first session since the user installed the game or application.

The property value is true for the first session and false for the subsequent sessions. If the user reinstalls the game or application, the sessionFirstRun status resets.

Note: On macOS, the session information is stored in the user's defaults system using NSUserDefaults class. The operating system retains this information even when the application is uninstalled or reinstalled. Use PlayerPrefs.DeleteKey method to delete this information manually. For example, PlayerPrefs.DeleteKey("unity.player_sessionid");