private void InitDeviceProfile() { #if !UNITY_EDITOR InitBridge(); #if (UNITY_IPHONE || UNITY_ANDROID) Platform.utController = new UserTrackingController(bridge); NPNFMain.UTController = Platform.utController; NPNFBridge.Instance.UnityBridge = bridge; #endif #endif #if UNITY_EDITOR || UNITY_WEBPLAYER || UNITY_STANDALONE DeviceProfile = new DeviceProfile(); DeviceProfile.deviceIdentity["userAgent"] = "UserAgent"; // set mac address string macAddress = GetMacAddress(UnityEngine.Network.player.ipAddress); Dictionary <string, object> deviceIds = DeviceProfile.deviceIdentity[DeviceProfile.IDKEY_DEVICEIDS] as Dictionary <string, object>; deviceIds.Add("macAddress", macAddress); #elif UNITY_IPHONE DeviceProfile = new IOSDeviceProfile(); ((IOSDeviceProfile)DeviceProfile).SetiOSDeviceInfo(bridge.GetIDFA(), bridge.GetIDFV(), bridge.GetUserAgent(), bridge.GetLimitingAdTrackingEnabled()); #elif UNITY_ANDROID DeviceProfile = new AndroidDeviceProfile(); ((AndroidDeviceProfile)DeviceProfile).SetAndroidDeviceInfo(bridge.GetUserAgent()); #else DeviceProfile = new DeviceProfile(); #endif }
public void RefreshDeviceProfile() { #if UNITY_IPHONE IOSDeviceProfile devProfile = new IOSDeviceProfile(); devProfile.SetiOSDeviceInfo(bridge.GetIDFA(), bridge.GetIDFV(), bridge.GetUserAgent(), bridge.GetLimitingAdTrackingEnabled()); DeviceProfile.deviceIdentity = devProfile.deviceIdentity; #endif #if UNITY_ANDROID AndroidDeviceProfile devProfile = new AndroidDeviceProfile(); devProfile.SetAndroidDeviceInfo(bridge.GetUserAgent()); DeviceProfile.deviceIdentity = devProfile.deviceIdentity; #endif }