ldoogy February 2016

Uniquely identify iOS iTunes accounts using App Store receipts?

There are several questions on SO that discuss mechanisms for uniquely identifying iOS users by their iTunes account (for instance, Uniquely identifying an iOS user). I've been trying to implement this in a different way, basically using the App Store receipt's opaque value field. This article seems to suggest that (at least for OS X apps) the opaque value field basically contains a unique ID to the user's iTunes account (NOT the email address, of course!), which suggests that this ID would be the same for different devices under the same iTunes account.

I've tried this on apps with no in-app purchase implemented, but I'm seeing that while the appStoreReceiptURL property of NSBundle contains a valid URL, that file never exists in the apps that I've tried (which were downloaded from the app store and were then updated with the test code using Xcode).

Is the receipt supposed to always exist, even for free/paid apps without IAP? Has anyone attempted to uniquely identify iTunes users using the receipt? It seems like a very promising approach.

Answers


Mark February 2016

You need to make an SKReceiptRefreshRequest to generate a receipt if you can't find one.

let receiptRequest = SKReceiptRefreshRequest()
receiptRequest.delegate = self
receiptRequest.start()

The below link has tips for a few other issues you may encounter:

App Store Receipt Validation

Post Status

Asked in February 2016
Viewed 2,770 times
Voted 4
Answered 1 times

Search




Leave an answer