Reputation: 865
I have looked through apple official document and from iOS7 there is no way i can get any hardware address such as mac address or wifi mac address of iphone programmatically.So if I want to keep my device identity unique and same, even after deleting the application,does any way i can achieve this through code. Thanks in advance.
Upvotes: 0
Views: 1616
Reputation: 11770
Actually, there are a ways to accomplish what you want.
Option1: Use identifierForVendor
, as Jay suggested or generate your own unique value and store it in the keychain. Values stored in the keychain persist till complete reinstall or reset of the iOS.
Option2: Use advertisingIdentifier
of the AdSupport
framework. This value will not be changed if user will not change it manually from the settings or reinstall/reset the iOS completely. But with advertisingIdentifier
you have to keep in mind that this only can be used to keep track of the ads, i.e. your app should display ads different from iAd, as iAd doesn't require AdSupport
framework.
Upvotes: 2