- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
对于 iOS 的应用内购买,我们可以 use an online API for validation ,这意味着我们可以在我们自己的服务器上验证购买。
是否有任何方法(API)可以验证 OS X 的应用内购买?
我只找到this snippet about in-app validation for Mac而且Apple似乎没有提供任何在线验证的API。
或者 Apple 可能有一些支持 OS X 在线验证的计划?
最佳答案
我的应用程序EasyBooks提供用户每年付费的在线组件。将其作为非消耗类型提供是没有意义的,因为它实际上只能作为消耗品使用(但它实际上是 iOS 中的非重复订阅)。我想在应用程序内提供此功能,我想我终于找到了解决方案......
我使用了一张 Apple DTS 票证来查询 StoreKitGuide 文档中的声明。它说...
"OS X supports both the server validation method described in this chapter and the local validation method..."
我收到 Apple 的回复说...
"The steps for verifying your In-App Purchase products for Mac applications are the same used for iOS applications. The difference is that you will be assigning your base 64 encoded app receipt (rather than the content of the transactionReceipt property) to the receipt-data field. Retrieve the full Mac App Store receipt for your application, then encode it using base64 encoding. Create a JSON object with a single key named receipt-data and assign your encoded receipt to it. Proceed as outlined in the Verifying a Receipt with the App Store section of the In-App Purchase Programming Guide.
Note: In App Purchases receipt are included in the associated Mac app's receipt. You must check the receipt associated with your app to verify the validity of the In-App Purchase receipts that it contains. Doing so also allows you to enable the appropriate functionality in your app."
因此,经过几次失败的尝试后,我确实成功地实现了这一点,但需要注意的是,Apple 服务器返回的收据数据不包含“GUID 的哈希值”,因此不会将收据数据与任何特定硬件绑定(bind)。
可以使用以下步骤在 Mac 上轻松测试:
找到 Mac 应用收据文件(运行应用并输入(测试)Apple ID 和密码后,该文件位于应用的 bundle 中。
在命令行中,base64 -i receipt
将对收据进行 base64 编码不换行(这一点很重要)
再次在命令行,curl -d '{ "receipt-data": "<your b64 string here>" }' https://sandbox.itunes.apple.com/verifyReceipt
这将返回以下格式的 JSON 数据
{"status":0,
"environment":"Sandbox",
"receipt":{"adam_id":"0",
"bundle_id":"uk.co.geode.easybooks",
"application_version":"2.2.7",
"download_id":"0",
"in_app":[ {"quantity":"1",
"product_id":"uk.co.geode.easybooks.syncing",
"transaction_id":"1000000034508678",
"purchase_date":"2012-09-05 12:00:17 Etc/GMT",
"original_transaction_id":"1000000034508678",
"original_purchase_date":"2012-01-24 10:16:17 Etc/GMT"} ]}}
我还没有确认这一点,但显然(根据苹果工程师的说法)任何消耗类型的应用内购买都会在首次购买时添加到收据中,但在任何进一步购买或恢复操作后会被删除。我想知道让应用程序中运行的代码在每次购买后复制收据文件是否是一个好主意,以防万一我们自己的服务器在应用程序尝试验证收据时出现故障。用户可能会尝试恢复购买,但没有意识到这会删除任何消耗品收据。
希望对您有所帮助。
(以下为原始评论)
我也有同样的问题。我的商店中有一个 iOS 应用程序,其中包含可在应用程序内购买的消耗品和非消耗品。消费品是一种服务,由我的网络服务器实现。在 StoreKit 委托(delegate)方法 paymentQueue:updatedTransactions: 中,我使用 transactionReceipt 属性,它是一个 NSData 对象。我将其编码为 Base64 并将其发送到服务器。在服务器上,我将收据传递给 Apple 的服务器进行验证。
但对于 Mac OS,SKPaymentTransaction 上没有 transactionReceipt 属性,因此我们无法以相同的方式验证收据。
我们可以生产非消耗性产品,这可能会对您有所帮助。在 Mac OS 上进行应用内购买时,收据会在应用程序包中更新。然后可以解析收据文件,查找每个应用内收据,这些收据都存储在主包的收据文件中。有关更多信息,请参阅 http://developer.apple.com/library/mac/#releasenotes/General/ValidateAppStoreReceipt/_index.html
当我使用非消耗品时,这对我来说效果很好,但我有一种消耗品,并且它未更新到应用程序的收据文件中。如果没有 transactionReceipt 属性,我看不到服务器有任何方法来验证收据是否真实。如果其他人有任何其他经验,请告诉我们!
拥有 Apple 开发者帐户的任何人都可以在 Apple 开发者论坛上阅读此内容: https://devforums.apple.com/message/548411#548411
关于macos - Mac App Store 应用内购买的在线收据验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7598047/
我一直在尝试将 Redux 集成到项目中。 我按照使用示例进行操作,但收到错误store.getState is not a function。 所以我知道其他人也问过类似的问题,但情况略有不同。 R
我正在尝试将我的第一个应用程序上传到 App Store。我已完成 iTunes Connect 所需的所有步骤,我的应用程序状态为“等待上传”。 我相信下一步是使用 Application Load
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭10 年前。 Improve th
App Store 有所谓的“服务器到服务器”通知。也就是说,当您购买应用内功能时,Apple 服务器会向您服务器的回调方法(发送收据数据)发出 HTTPS 请求。 问题是 - 收据数据中似乎没有用户
我已经将我的第一个应用程序上载到App Store,但是我没有放置我的App需要位置服务和wifi的UIRequiredDeviceCapabilities。结果:该应用程序没有像应做的那样开始寻找坐
由于iOS 8将于本月发布,并且我的应用仅支持32位(因为第3个库仅兼容32位),因此我不确定如果我将新版本的应用提交给我,则该应用的新版本是否会被拒绝App Store将于下个月发布,因为它不支持6
我有一个让我有些困惑的问题。 为了将我的应用提交到App Store,我必须输入Bundle ID后缀。如您所知,Bundle ID会获得Bundle ID后缀的确切名称(您在Bundle ID后缀上
如问题所述,我想知道更新后的应用程序一旦获得批准,是否会自动发布到应用程序商店中? 我的更新已完成并且已经过测试,由于需要几天的时间才能批准,因此我希望现在将其提交批准。同时,我需要在服务器上更改一些
获取应用程序提交到 Apple App Store 的屏幕截图的最简单方法是什么,需要包含的各种尺寸是多少? 另外,是否允许状态栏?我相信我听说它不是,但是包括 Facebook 和 Quora 在内
我在 iTunes 商店中有一个应用程序,其分发证书(在 key 链访问中)将于明天到期。它是一年前生成的,尽管我最近更新了我的 iPhone 开发者计划,但我还没有更新任何证书或签名。 当我将测试设
我的商店包含以下 reducer : export const centralStampState = { layoutState : layoutReducer, //this one is n
我即将将我的应用程序提交到 Apple App Store,并且我了解到 Apple 需要两周时间才能对其进行审核,然后才能上线。但是,在 iTunes Connect 的定价部分,它询问我什么时候发
如果我的应用程序正在接受审核或已获得批准(因此处于 Ready For Sale 状态或同等状态),我可以编辑哪些应用程序信息而无需提交应用程序的新版本? 最佳答案 据此Apple Documenta
我已经在Opera管理控制台上进行了全面检查,看不到他们在哪里提到付款方式。他们说明何时制作,但没有说明。即Paypal,Cheque等。 有人知道他们如何付款吗? 最佳答案 当金额达到200美元时,
我上传了我的二进制文件并创建了屏幕截图。我做的所有屏幕截图都是 640x960,我将它们上传为 PNG。这背后的想法是,我应该以尽可能最好的质量把它交给他们,这样当他们将它们重新压缩成 320x480
我从Microsoft下载了Windows 8 app samples,并下载了这些示例之一加速度传感器示例 我不知道如何测试它以计划使用此功能的软件? 我没有水面设备,想知道只有一种方法可以做到吗?
我正在为TestFlight上传第二个应用程序。第一次进展顺利,但这次却被拒绝了。 We have started the review of your beta app, but we are no
不确定这是正确的论坛,如果不是,我提前道歉。 某处是否有 App Store 新版本的提要?还是带有类别和发布日期的应用提要/列表? 此列表已从 App Store 中消失,我想看看是否可以制作一个应
我有一个 JSON 存储,定义如下 var subAccountStore = new Ext.data.JsonStore({ autoLoad: true, proxy: { ty
我有一个提交到应用商店的应用被拒绝,原因是: 2.30 不符合 Mac OS X 文件系统文档的应用将被拒绝 他们声称我的应用正在修改不受支持的 ~/Library/Preferences/com.a
我是一名优秀的程序员,十分优秀!