Exemplo n.º 1
0
 private static void GetAdvertIdFromUnity()
 {
     Application.RequestAdvertisingIdentifierAsync(delegate(string advertisingId, bool trackingEnabled, string error)
     {
         PlayFabSettings.DisableAdvertising = !trackingEnabled;
         if (!trackingEnabled)
         {
             return;
         }
         PlayFabSettings.AdvertisingIdType  = "Adid";
         PlayFabSettings.AdvertisingIdValue = advertisingId;
         PlayFabDeviceUtil.DoAttributeInstall();
     });
 }
Exemplo n.º 2
0
        public static void OnPlayFabLogin(PlayFabResultCommon result)
        {
            LoginResult loginResult = result as LoginResult;
            RegisterPlayFabUserResult registerPlayFabUserResult = result as RegisterPlayFabUserResult;

            if (loginResult == null && registerPlayFabUserResult == null)
            {
                return;
            }
            PlayFabDeviceUtil._needsAttribution = false;
            PlayFabDeviceUtil._gatherInfo       = false;
            if (loginResult != null && loginResult.SettingsForUser != null)
            {
                PlayFabDeviceUtil._needsAttribution = loginResult.SettingsForUser.NeedsAttribution;
            }
            else if (registerPlayFabUserResult != null && registerPlayFabUserResult.SettingsForUser != null)
            {
                PlayFabDeviceUtil._needsAttribution = registerPlayFabUserResult.SettingsForUser.NeedsAttribution;
            }
            if (loginResult != null && loginResult.SettingsForUser != null)
            {
                PlayFabDeviceUtil._gatherInfo = loginResult.SettingsForUser.GatherDeviceInfo;
            }
            else if (registerPlayFabUserResult != null && registerPlayFabUserResult.SettingsForUser != null)
            {
                PlayFabDeviceUtil._gatherInfo = registerPlayFabUserResult.SettingsForUser.GatherDeviceInfo;
            }
            if (PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null)
            {
                PlayFabDeviceUtil.DoAttributeInstall();
            }
            else
            {
                PlayFabDeviceUtil.GetAdvertIdFromUnity();
            }
            PlayFabDeviceUtil.SendDeviceInfoToPlayFab();
        }