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.