Menu

Get distinct_id

       This function is used to obtain the distinct_id of the current device.

Function

//Non-HarmonyOS Platforms

 public static void getDistinctId()

//HarmonyOS Platform

 public static void getDistinctId(Action<string>distinct)

Sample Code

 private void GetDistinctIdHandler()
    {
#if UNITY_OPENHARMONY&&!UNITY_EDITOR
        SolarEngine.Analytics.getDistinctId(_distinct);
#else
        string distinctId = SolarEngine.Analytics.getDistinctId();
#endif
    }
#if UNITY_OPENHARMONY&&!UNITY_EDITOR

    private void _distinct(string distinct)
    {
        string distinctId = distinct;
    }
#endif

       The distinct_id and distinct_id_type will be returned.

distinct_id_typeDescription
-1This value will be returned for iOS or Android.
1101openid is returned for MiniGame
1102anonymousopenid is returned for MiniGame
1103uuid is returned for MiniGame


Previous
Set ATT Authorization Waiting
Next
Visitor ID
Last modified: 2025-07-14Powered by