Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

getInfo( "deviceID" ) return value changes on every build
Started by horacebury Jul 28 2014 04:15 AM

7 replies to this topic
system getinfo deviceid

Best Answer ingemar , 29 July 2014 - 12:41 AM

It's a bit of a problem to ensure that you get the same ID across installations. Apple's UDID is long gone, but I think that the OpenUDID plugin that Ed posted a link to above might be your answer. 

 

However, the developer of the library has deprecated it (for iOS at least) in favor of Apple's advertisingIdentifier, so I assume that there's going to be no active support for it anymore.

http://blog.appsfire.com/udid-is-dead-openudid-is-deprecated-long-live-advertisingidentifier

 

OpenUDID claims to generate a persistent unique ID per device. I haven't used it myself so I don't know how it will work across installations. Even though it's deprecated I guess it's OK to use for the kind of things you have in mind.

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

Seriously, every time I do a new build the return value of system.getInfo("deviceID") changes. I was hoping there would be a way for my app to detect the device it is on if it were uninstalled and reinstalled.

 

Am I doing this the wrong way or is the info required not available in Corona?



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,588 posts
  • Corona SDK

1. I thought that system.getInfo( "deviceID" ) was some what negated by iOS6+ changes. i.e. Not a real ID, but unique, so useful as an identifier in general.

 

2. I'm surprised however it is returning a new value each time.  I thought it was supposed to be a hash of the devices ID, which should not change unless I'm confused here.

 

3. Have you considered, the UDID plugin: http://docs.coronalabs.com/daily/plugin/openudid/index.html

 

4. Have I totally missed the point (happens sometimes)?

 

Cheers,

 

Ed

 

PS - Uninstalled and re-installed?  Are you trying to detect if the app was uninstalled and re-installed on the SAME device or moved to another device, as in a pirated app?



[TOPIC: post.html]
#3

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

@horacebury
 
The Corona deviceID gets its value from the identifierForVendor property of the UIDevice Class.
Unfortunately this ID can change when a user deletes/reinstalls an app.
 

From the UIDevice Class reference page:
 
The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.



[TOPIC: post.html]
#4

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

Thanks guys.

 

I'd really like to know how to identify when my app has been installed onto the same device, different version or not. Is this possible outside of the UDID (which I thought (?) was deprecated and doesn't work on Android (?))

 

I'm pretty sure I've seen apps which detect that they're on the same device as before - I assumed this was by registering the device ID on a server.



[TOPIC: post.html]
#5

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

  Best Answer

It's a bit of a problem to ensure that you get the same ID across installations. Apple's UDID is long gone, but I think that the OpenUDID plugin that Ed posted a link to above might be your answer. 

 

However, the developer of the library has deprecated it (for iOS at least) in favor of Apple's advertisingIdentifier, so I assume that there's going to be no active support for it anymore.

http://blog.appsfire.com/udid-is-dead-openudid-is-deprecated-long-live-advertisingidentifier

 

OpenUDID claims to generate a persistent unique ID per device. I haven't used it myself so I don't know how it will work across installations. Even though it's deprecated I guess it's OK to use for the kind of things you have in mind.



[TOPIC: post.html]
#6

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

I was reading about OpenUDID, and it looks like there are issues with it under iOS 7+. So it appears we're back at square one again...



[TOPIC: post.html]
#7

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

It appears as though "advertisingIdentifier" is not available in iOS through Corona. Am I right here? It looks like this would be a pretty good solution, though obviously not what Apple is intending it for, I guess.



[TOPIC: post.html]
#8

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

The advertising identifier (IDFA) found in the AdSupport framework, was removed from the Corona core (I think in build 2169), since Apple started rejecting apps that could reference the AdSupport framework without using it for advertising.

 

Apple has implemented strict rules on how the IDFA is used, and if it isn't used according to their rules the app will be rejected. Basically the only allowed usage of the IDFA is for ad tracking.




[topic_controls]
[/topic_controls]