问题
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.
回答1:
No, it's not possible.
Instead of AppleId, you can use [[UIDevice currentDevice] identifierForVendor]
.
回答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]
回答3:
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:
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
回答5:
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.
回答6:
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
回答7:
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
来源:https://stackoverflow.com/questions/25989250/users-appleid-programmatically-in-iphone