7

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
zohaibkhan
  • 227
  • 1
  • 2
  • 12

7 Answers7

6

No, it's not possible.
Instead of AppleId, you can use [[UIDevice currentDevice] identifierForVendor].

l0gg3r
  • 8,864
  • 3
  • 26
  • 46
2

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]
Community
  • 1
  • 1
Kevin Machado
  • 4,141
  • 3
  • 29
  • 54
1

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.

iHulk
  • 4,869
  • 2
  • 30
  • 39
1

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

biruk1230
  • 3,042
  • 4
  • 16
  • 29
Yogesh Bangar
  • 480
  • 4
  • 12
0

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

http://blog.revivalx.com/2014/08/29/implement-push-notifications-for-android-and-ios-phonegap-part-2/

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.

Nurdin
  • 23,382
  • 43
  • 130
  • 308
0

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

Gil Sand
  • 5,802
  • 5
  • 36
  • 78
0

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