如何验证服务器上的IOS应用程序内购买 [英] How to verify ios In-App Purchase on your server

查看:125
本文介绍了如何验证服务器上的IOS应用程序内购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我到建设我的第一个应用程序内购买应用程序。我想知道是否有验证您的服务器上购买的一种方式。

I am up to build my first in-app purchase app. I would like to know whether there is a way to verify purchase on your server.

我要建全用户管理,我想知道什么,他们已经买了自己的iOS设备上的所有已注册的用户,让他们得到免费的Web应用程序,或者类似的东西。那么,有没有办法为我检查苹果专卖店的一面,如果用户已经购买了一些产品?

I have to build the whole user management, and I would like to know for all registered user what they already bought on their iOS devices, so that they get web app for free, or something like that. So, is there a way for me to check on Apple store side, if this user has already buy some product?

编辑:

情景是这样的:

用户A的移动设备购买附录二。这之后,我想检查我的服务器上(我的网页上,...)如果用户A是买来的应用B,或(类似)的应用程序是由用户A买了。

User A buy app B on mobile device. After this I would like to check on my server (on my web page,...) if user A is bought app B, or (similar) which app was bought by user A.

我不希望从移动设备发送信息到我的服务器用户A购买的应用程序B,因为用户可以复制服务器上此调用,即使他们没有购买的应用程序B.

I don't want to send message from mobile device to my server that user A buy app B, because users can reproduce this call on server even if they didn't buy app B.

我会检查服务器端丝毫应用商店,如果用户A买附录二。

I would check on server side whit app Store if user A bought app B.

推荐答案

获取应用程序的收据(从文件在 [一个NSBundle mainBundle] appStoreReceiptURL] ),并将其发送到服务器。然后,要么...

Fetch the app's receipt (from the file at [[NSBundle mainBundle] appStoreReceiptURL]) and send it to your server. Then either…


  • 解析接收和对苹果的证书检查它的签名<一个href=\"https://developer.apple.com/library/mac/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateLocally.html\"相对=nofollow>这里描述(您的服务器上,而不是在应用程序)。或者,

  • Parse the receipt and check its signature against Apple's certificate as described here (on your server, not in the app). Or,

发送回执(再次,从你的服务器)的应用程序商店进行验证<一个href=\"https://developer.apple.com/library/mac/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html\"相对=nofollow>这里描述。

Send the receipt (again, from your server) to the app store for validation as described here.

这篇关于如何验证服务器上的IOS应用程序内购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆