Reading iPhone Information (VB.NET) - ios

Has anyone found out a way to read the device which is plugged in and return a serial number for that device?
For example, I am wanting to read my iPhone Serial Number which is plugged into a USB Port, I am wanting my application to tell me my serial number for that device.
Is there a way to do this??
Thank You
J Mahone

Doubt you could get it via USB. You CAN write a small iOS App (like add one line of code to an Xcode App created with New Project) to get it and NSLog it, using:
[[UIDevice currentDevice] uniqueIdentifier];
As per the docs, this is deprecated and may not be supported in future. Also, if you try to submit ANY app that uses this to the App store, it will be rejected during review. This doesn't apply to Enterprise Apps, only Apps submitted to the store. And nothing stopping you from writing one for your own use.
The 'Approved' device ID now is Advertising ID.
Also... now that I think about it, if you search around in the iOS App store for UUID you will find a bunch of FREE Apps that will display that information on the screen for your device.

Related

Get device UDID (40 digit id) programmatically [duplicate]

This question already has answers here:
UIDevice uniqueIdentifier deprecated - What to do now?
(32 answers)
Closed 5 years ago.
In my app, I am trying to get all information of the device and to be displayed in app screen.
I got some of the informations, but not getting code to obtain UDID, Serial number and model identifier of a device, what we can able to see in iTunes.
I can able to get UUID, but my request is to get UDID of the device. I got some apps in which they are getting device info like this.
I will be very helpful if I get any solution in this.
Thanks in advance.
You can't as of iOS 6.
Link #1
Money quote:
As reported by 9to5Mac (and confirmed by Macworld), Apple alerted
developers of a cut-off date for new apps or app updates that access
an iOS device’s UDID (Universal Device ID), an area of security and
privacy concern.
Link #2
Extended money quote:
With iOS 6 Apple has also completely eliminated its controversial
Universal Device IDs (UDID) and replaced it with a more
privacy-friendly way for application vendors and advertisers to
identify specific devices, Hall said,
Apple’s UDIDs are basically a set of alphanumeric characters that are
used to uniquely identify an iPhone or iPad. The numbers are designed
to let application developers track how many users have downloaded
their application and to gather other information for data analytics.
From the same article, the way to go now is:
With the new iOS 6 the company has gone one step further by
eliminating UDIDs completely and replace with a set of three new devie
identifiers. One is a vendor specific identifier that can be used by
application vendors to recognize specific devices, another is designed
for use by online advertisers and the third is an application-specific
ID. Unlike UDID’s, the new identifiers are not persistent and can be
cleared, though the device has to be completely reset to get rid of
the advertiser identities, Hall said.
In conclusion, the correct way is to either (a) use UUID or (b) ask your user for the device's UDID.
You can use this (Swift 3):
UIDevice.current.identifierForVendor!.uuidString

Best way to uniquely identify iOS device?

I'm aware if the following methods, each which has it'd flaws
UDID
Advertising Identifier
Vendor ID
The problem with UDID is that its deprecated and doesn't even work as of ios7, problem with other two is that the user can change them via software reset of phone or reinstallation of app
Another interesting solution I found is to randomly generate one yourself and then save to keychain to avoid deletion upon app reinstallation however would this work across software resets? And surely there's a very small chance that two devices would randomly generate the same ID?
I think the best option might be to use UDID but I would like to know if, even though the UDID is incorrect as of ios7, is it still unique?
Yet another option is MAC address but as far as I know, there is no API for these
Please advise on the best option
Starting iOS 7 deducing MAC address isn't possible. You can, however, use below:
[[[UIDevice currentDevice] identifierForVendor] UUIDString]
Per Apple Documentation:
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 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.

iOS 8 Unique Identifier (Serial Number preferred)

I am working on an enterprise app and need access to programmatically retrieve the device's serial number. Is there an API or any documentation on how to retrieve this in iOS 8? From what I can tell, this functionality has been removed in iOS 8.
Is there a suitable replacement identifier for the serial? I need something that is reliable and will never change even if the device is reset.
It will be for enterprise usage so App Store approval is not a concern.
You're up a creek here. The two "tracking" features are Advertising Identifier and Identifier for Vendor. The former can be reset within the Settings app quite easily while the latter will reset once the user uninstalls all apps with the root bundle identifier associated with the app suite. Both also change with a device reset of course.
If you're deploying the app with an MDM solution you will have access to that device's UDID as it still flows forward to MDM servers, you just can't access it programmatically in your code. The complete deprecation of UDID, serial number and MAC address (even with private APIs) stomped all over some custom utilities I wrote within our Enterprise to try and accomplish something similar to what you're looking to do. If you find somethingthats consistent I'd love to see the follow-up!
EDIT:
I had an epiphany while circling back to this situation again. If you are in fact using AirWatch (I can't speak to Mobile Iron, etc) you can setup the console to send a keychain value to each device at the time of app install. From there the app will be able to consume the value AirWatch sends down. The same goes for any attribute that AirWatch harvests for the device (serial, UDID, MAC, etc). While this workaround comes with a big caveat (using AirWatch for deployment) it will work. Since Apple neutered all Serial Number work arounds win iOS8 this is the most viable option I have found.

Uniquely Identify iOS device over multiple users

I have done a lot of research on this so please read the question before marking this as similar to some other question.
Our app needs to uniquely determine an iPhone such that even when user completely wipes a phone, when he runs our app we can be sure that it is the same device. The most important thing is we also need to determine devices over multiple Apple ID users so suggestions containing Keychain access and uniqueVendorID might not work as those change when another user starts using that phone. And as I have read using MAC addresses and old UDID for devices is not longer available as of iOS 6.0. I went through [UIDevice identifierForVendor] but this NSUUID changes when all the app by the same vendor has been uninstalled Reference.
I have looked through these resources:
UIDevice uniqueIdentifier Deprecated - What To Do Now?
and
What is a long-term method I can use to uniquely identify an iOS device?
I can not disclose the nature of work that my app performs due to non-disclosure, but to clarify what I require:
Multiple users might use our app on same phones, I need a way to know that the device user A used before and has reported to have handed over to user B is the same device on which our app was run. Is there any way to achieve this?
There's no way to achieve this.
If it's really the case that different users might use your app on the same device after a factory reset of the device, then what you want is not possible. Apple deprecated UIDevice uniqueIdentifier which would have been the way to do this.
as long as they dont restore/wipe the device identifierForVendor is ok

Finding IMEI number using Objective-C [duplicate]

This question already has answers here:
How to get IMEI on iPhone?
(7 answers)
Closed 2 years ago.
I need to find a way to get the IMEI number of an iPhone device. This question is not a duplicate.
I have gone through several forums including SO, and had no luck finding an answer.
Some say Apple doesn't allow developers to see the IMEI number (SO post), and some say to use UDID instead (SO post). Some say that UDID is deprecated (in iOS 7).
I need to know the following:
1.) Does Apple permit developers to retrieve the IMEI number of the device?
2.) How can i programatically do it?
3.) In case if Apple doesn't allow developers to gather the IMEI number, do they provide any other unique number for the device?
4.) Some suggest to use Telephony framework. If i do so, will apple reject my application?
Apple does not allow you to identify a device any more.
UDID, MAC address and all other device identifiers are no longer accessible or allowed by Apple.
Apple suggest that you use either UUID (which you will need to store your self or), identifierForVendor or advertisingIdentifier.
Apple is now also rejecting app that use the advertisingIdentifier and not showing any advertisements apps.
Any means to get the IMEI number are using private methods, which is also not allowed by Apple anymore. And your mobile app might/will get rejected because of this.
Unfortunately, there is no way to get a unique identifier for a device which will always remain the same. Apple no longer allows you to access the UDID. And in iOS 7, all devices' MAC addresses return the same value, so that is no longer useful either.
However, iOS does now give access to two types of identifiers which can be used to identify a device. They are:
Vendor ID - [UIDevice identifierForVendor]. This is a unique identifier which is the same for all apps from the same vendor or company. It will remain the same, so long as the user has at least one app from the vendor installed on their device. So if you have 3 apps, the vendor ID will remain the same unless the user uninstalls all three apps, and then reinstalls. This is not so useful if you only have one app - if the user deletes it and then reinstalls it, it will change.
Advertiser ID - [UIDevice advertisingIdentifier]. This is a unique identifier meant for advertising purposes. But if you use it for non-advertising purposes they, for the most part, won't care. Under most circumstances, the advertising identifier will not change, even if the user deletes and reinstalls the app. However, there is an option in the iOS settings to reset the advertising identifier, which will change it. This is meant to that users can choose to disassociate themselves from any advertising information which has been collected about them. But this is a very advanced setting and I doubt that many users would do this frequently enough that it would be a problem for you.
You can obtain IMEI using private frameworks -See this Question but probably your app will be rejected from app store then.
If you want to obtain some device identifier to use in your application you must use uniqueIdentifier property defined in UIDevice class
(Available in iOS 6.0 and later):
NSString *UDID = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
You can save UUID in keychain and user it as unique number. It won't change until user will reset iOS.
If you want to obtain the IMEI there is no way (on a non-jailbroken device). If you wish to identify the user take a look at this answer. Please pay attention to all documentation/answers written before iOS7 since things have changed.

Resources