# IOS Device ID Getter is Deprecated

**URL:** <https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885>\
**Category:** Mobile\
**Tags:** unreal-engine, device, iOS, question\
**Created:** [October 9, 2016, 3:42pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885 "2016-10-09T15:42:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 9, 2016, 3:42pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/1 "2016-10-09T15:42:06Z")

</div>

I can’t get unique device ID from an IOS device. Ready to use “Get Device Identifier” function doesn’t work as expected anymore. It is returning different values every time I reinstall the game. Since iOS 7, this function became “installation ID”, instead of “device ID”. This is a bug because this function doesn’t provide a device ID anymore.

Please have a look at this thread: [How to get unique id in iOS device? - Stack Overflow](http://stackoverflow.com/questions/19402327/how-to-get-unique-id-in-ios-device)

Please open a bug report for this.

And a question, how can I work this around?

I need device ID to provide these functions:

1- Keep users data even if he reinstalls or somehow losts data.

2- Ban cheaters by device ID (unless he learns a way to change device ID)

3- Prevent “save game” downloaders, by making save game files device specific.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_61b4a355](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_61b4a355](https://forums.unrealengine.com/u/anonymous_user_61b4a355)\
**Post date:** [October 10, 2016, 2:14pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/2 "2016-10-10T14:14:10Z")

</div>

Hey ,

Have you tried?

```
FString FIOSPlatformMisc::GetUniqueDeviceId()

```

Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [October 10, 2016, 2:36pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/3 "2016-10-10T14:36:52Z")

</div>

No I didn’t try, but as far as I’ve seen in the c++ code, this is what I was looking for. Thanks 🙂

Similar, actually even worse problem is occuring in Android too. I used this function to work this around: [Is there anyway to get a Unique device ID on Android? - Blueprint - Epic Developer Community Forums](https://answers.unrealengine.com/questions/346721/is-there-anyway-to-get-a-unique-device-id-on-andro.html?sort=oldest)

It looks like FGenericPlatformMisc::GetUniqueDeviceID() is returning mac address but I think OS companies don’t like sharing their users mac addresses anymore.

To keep the node compatible with old developers and for more flexible design, I think more developed “Get Unique Device ID” node would be better. There can be options on it like these:

bool Use Vendor ID if IOS

bool Use New Method if Android

**Edit:** It looks like identifierForVendor and mac address are providing the same functionality, they both reset when I reinstall the game. I don’t know how can I protect my game server from cheaters with this situation. It is very open to abuse.

However, there is a better variable for this but I don’t know how to get it from Unreal Engine: advertisingIdentifier. [ios - Under what conditions is Apple's 'advertisingIdentifier' reset? - Stack Overflow](http://stackoverflow.com/questions/16520231/under-what-conditions-is-apples-advertisingidentifier-reset)

It can be reset too, but not by reinstalling the game. It doesn’t provide proper ban functionality but at least can define the device for a longer time. I don’t know whether this is legal or not, if I use advertisements but use this for different purposes.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_61b4a355](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_61b4a355](https://forums.unrealengine.com/u/anonymous_user_61b4a355)\
**Post date:** [October 11, 2016, 6:36pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/4 "2016-10-11T18:36:53Z")

</div>

Hey ,

While I do understand your issue of wanting to protect your game with identifiers from the device, this doesn’t mean that it is a bug with the Unreal Engine. However, thank you for the report. If you still believe this may be a bug, please provide steps for us to reproduce the issue, and we will continue our investigation.

To clarify, “A bug is a defect in the engine code which results in an unexpected behavior, and can be reproduced under specific conditions.”

If you would like to include a feature request, such as adding or updating code, you can make a new thread in the “Feedback for Epic” section.

Lastly, as some general feedback to your issue, I would suggest looking into a way to create a account for your game. This way you can keep track of your base via a login page, giving you some administration control over who can login to your game.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_16aa15b4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_16aa15b4](https://forums.unrealengine.com/u/anonymous_user_16aa15b4)\
**Post date:** [November 17, 2016, 2:41am UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/5 "2016-11-17T02:41:57Z")

</div>

Hi, we are trying to use device ID on a mobile VR game. GetUniqueDeviceID always return exactly the same string -d41d8cd98fOOb204e9800998ecf8427e- on every single mobile device we tested. Does this only work on PC? Is there a function for android phones?  
We are forced to use this because your function for getting Oculus identity also only work on PC but not on mobile.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a08c0bf2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a08c0bf2](https://forums.unrealengine.com/u/anonymous_user_a08c0bf2)\
**Post date:** [November 21, 2016, 10:28pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/6 "2016-11-21T22:28:11Z")

</div>

,

> “In iOS 7 and later, if you ask for  
> the MAC address of an iOS device, the  
> system returns the value  
> 02:00:00:00:00:00. If you need to  
> identify the device, use the  
> identifierForVendor property of  
> UIDevice instead. (Apps that need an  
> identifier for their own advertising  
> purposes should consider using the  
> advertisingIdentifier property of  
> ASIdentifierManager instead.)”

The identifierForVendor property will give you a value that is unique for a given software application on a per device granularity. This enables a software vendor to uniquely identify a particular device among other devices, but it does not provide information about the particular device that happens to be, such as a MAC address would.

> **[iOS 7.0](https://developer.apple.com/library/archive/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html)**
>
> Describes new features introduced in versions of iOS.

---

<div class="post-metadata">

**Author:** ![theonecalledtom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@theonecalledtom](https://forums.unrealengine.com/u/theonecalledtom)\
**Post date:** [June 20, 2017, 5:24pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/7 "2017-06-20T17:24:53Z")

</div>

Any fix for this?

---

<div class="post-metadata">

**Author:** ![theonecalledtom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@theonecalledtom](https://forums.unrealengine.com/u/theonecalledtom)\
**Post date:** [June 20, 2017, 6:31pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/8 "2017-06-20T18:31:15Z")

</div>

It looks like this is what the engine uses now, however my iPad and iPhone are both reporting the same value (d41d8cd98fOOb204e9800998ecf8427e).

```
FString FIOSPlatformMisc::GetDeviceId()
{
	// Check to see if this OS has this function
	if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)])
	{
	    NSUUID* Id = [[UIDevice currentDevice] identifierForVendor];
	    if (Id != nil)
	    {
		    NSString* IdfvString = [Id UUIDString];
		    FString IDFV(IdfvString);
		    return IDFV;
	    }
	}
	return FString();
}

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [June 20, 2017, 8:11pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/9 "2017-06-20T20:11:04Z")

</div>

I am using deprecated blueprint function “Get Unique Device ID” and it is working fine, because IOS is sending vendor id even if I request MAC address. However I don’t know whether you can add deprecated function nodes in blueprints, or not.

Did you try new function? “Get Device ID”

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_089a4978](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_089a4978](https://forums.unrealengine.com/u/anonymous_user_089a4978)\
**Post date:** [June 20, 2017, 8:13pm UTC](https://forums.unrealengine.com/t/ios-device-id-getter-is-deprecated/372885/10 "2017-06-20T20:13:35Z")

</div>

Hi, did you try resetting your vendor id? Maybe IOS is giving same id to same accounts.
