ios - 如何分配 skpayment 应用程序用户名

标签 ios objective-c in-app-purchase skpaymenttransaction

我们可以分配 skpayment applicationusername 吗?

应用内购买完成后,我在 SKPayment 中得到一个空的 applicationUsername。

如何为 SKPayment applicationUsername 赋值?

最佳答案

您不能为 SKPayment 的属性赋值;当您创建 SKMutablePayment 实例以提交购买请求时,您的应用程序可以提供一个代表应用程序用户 ID 的不透明值。这使 iTunes 商店能够检测到不正常的事件。

尽管名称如此,applicationUsername 属性并不意味着保存实际 用户名。

建议的方法显示在 In-App Purchasing Programming Guide

请注意,您分配的值 may not be present在您在交易队列中收到的 SKPayment 中。

Important

The applicationUsername property is not guaranteed to persist between when you add the payment transaction to the queue and when the queue updates the transaction. Do not attempt to use this property for purposes other than providing fraud detection.

关于ios - 如何分配 skpayment 应用程序用户名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37202248/

相关文章:

ios - 如何使用 GCD 说明后台任务?

iphone - 导航 Controller 中的工具栏

ios - paypal、支付宝支付必须要设置InAppPurchase吗

ios - 关于 Property not found Xcode 5 错误

ios - calloutAccessoryControlTapped 后的空白 ViewController

ios - Swift 在每个部分中选择一个单元格

ios - 如果部署目标低于 iOS 7,状态栏样式的轻内容?

ios - UITableView 和 indexPathsForSelectedRows

ios - 用户通过swift在Apple In app purchase上购买某些商品时如何获取一些用户信息?

ios - 错误 21007 : status result returned by Apple during in-app subscription restore