我创建了一个允许用户购买非消耗性内容的应用程序。检索 ids 支付过程就像一个魅力,但我也希望,当交易完成并请求下载内容时,我想保存谁下载了这个内容。在我的观察者中,我已经实现了方法:
- (void)completeTransaction: (SKPaymentTransaction *)transaction{
NSLog(@"completeTransaction");
[[ShopHandler sharedManager] provideContent:transaction.payment.productIdentifier];
[[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}
在我的 ShopHandler 我有 provideContent 方法
-(void) provideContent: (NSString*) productIdentifier {
Here i want to retrieve the user that has bought this product and
then perform a request to my server
e.g http://www.tesserver.com/download?id=com.my.id.test&itunesid=test@itunes.com
}
那么我如何检索该iTunes ID?
编辑:
Apple 在他们的 iPhone 开发中心介绍 Store Kit 视频中指出,我们应该:
“在云中的服务器中保留 TransactionID 和客户信息的副本。这样,如果客户错误地删除了您的应用程序,您就有了恢复机制。您可以在首次启动应用程序时检查您的服务器以获取记录为给定客户的购买量,并将该应用程序恢复到删除之前的状态。相信我,您的客户会很感激的!”
那么他们是什么意思呢?