3

I have used following code for getting the IMEI number of iPhone in objective-c:

NSString *imei = [[NetworkController sharedInstance] IMEI];

But I am getting this error, Use of undeclared identifier "NetworkController" I have imported AFNetworking.h but I can not solve this error. Can anybody help me for solving the issue?

SNarula
  • 548
  • 3
  • 16
Hari Mohan
  • 214
  • 1
  • 4
  • 16

2 Answers2

10
You can get the UDID, but can not get the IMEI.Apple does not allow this.
Niharika
  • 1,188
  • 15
  • 37
  • 1
    As of iOS 5 you can no longer get the device UDID but you can get the vender ID which is something like an vendor specific device ID that will be a different value if the user re-installs the application and there is no other application from the same vendor. – Rikh Jan 17 '17 at 06:05
  • Now a days, it is better to use UUID as a unique identifier for a user. – Shobhit C Feb 18 '17 at 19:50
  • From IOS 5, Apple restricted to get the UDID. So its not possible. Wrong answer. – Balaji Kondalrayal Nov 30 '17 at 08:00
3

You can't get IMEI number of iPhone. It is against security policy of Apple. Apple may reject your app.

Also, check this: Finding IMEI number using Objective-C

Community
  • 1
  • 1
SNarula
  • 548
  • 3
  • 16