is this possible to get the user's apple id which is currently login to device? Actually I implemented inapp purchases and I get a device id and Apple id of the user when it purchase the app.
7 Answers
No, it's not possible.
Instead of AppleId, you can use [[UIDevice currentDevice] identifierForVendor]
.

- 8,864
- 3
- 26
- 46
No, you can't. It's a privacy element like the UDID.
You can read more about this here : Privacy issue
But, if you want, you can use the identifierForVendor provided by Apple using this method :
[[UIDevice currentDevice] identifierForVendor]

- 1
- 1

- 4,141
- 3
- 29
- 54
It's not possible. You can only retrieve the device's UDID. it's a privacy issue, just like their phone number. But you can get the certificate (Acknowledgement) for every purchase from apple server for a particular user.

- 4,869
- 2
- 30
- 39
No you can't get Apple Id. Instead of that you could use identifierForVendor.
Objective-c:
[[UIDevice currentDevice] identifierForVendor]
Swift 3+:
UIDevice.current.identifierForVendor?.uuidString
If you want to read more about collecting user data check this out Apple Policy!
or you can use this (Swift 3):
UIDevice.current.identifierForVendor!.uuidString
For older versions:
UIDevice.currentDevice().identifierForVendor
or if you want a string:
UIDevice.currentDevice().identifierForVendor!.UUIDString

- 3,042
- 4
- 16
- 29

- 480
- 4
- 12
I'm not sure about apple id but you can grab device id programmatically. If you using hybrid app, you can using push phonegap plugin.
https://github.com/phonegap-build/PushPlugin
For native
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
BTW, device id and UDID is a different thing.

- 23,382
- 43
- 130
- 308
-
I have to retrive the apple id not the device id . by which user is currently login.? – zohaibkhan Sep 23 '14 at 08:45
-
1device id you can get it from user, if apple id i think cant. I never heard about it. – Nurdin Sep 23 '14 at 08:52
Nope, you can't get that information. The only thing you can get are information from UIDevice (look it up on the apple doc) or a "fake UDID" (unique key that isn't the UDID) using [[UIDevice currentDevice] identifierForVendor]
, and the IP.
So you can identify your users in a unique way, but not get their information.
I really suggest you go browse the doc about the UIDevice, maybe you'll find something that you need there too

- 5,802
- 5
- 36
- 78
ou can use this (Swift 3):
UIDevice.current.identifierForVendor!.uuidString For older versions:
UIDevice.currentDevice().identifierForVendor or if you want a string:
UIDevice.currentDevice().identifierForVendor!.UUIDString

- 3
- 1