【iOS】苹果内购调研

参考文章

什么时候使用苹果内购

微信和支付宝在国内已经有大量用户,用起来也很方便,估计开发者也不愿意为此再折腾苹果内购,所以,界定什么时候必须用苹果内购是必要的.

官方文档Understanding What You Can Sell Using In-App Purchase中,对于什么能卖,什么不能卖,做了指导.

You can use In-App Purchase to sell content, app functionality, and services.

*   Content. Deliver digital content or assets, such as magazines, photos, and artwork. Content can also be used by the app itself—for example, additional characters and levels in a game, filters in a camera app, and stationery in a word processor. 

*   App functionality. Unlock behavior and expand features you’ve already delivered. Examples include a free game that offers multiplayer mode as an in-app purchase and a free weather app that lets users make a one-time purchase to remove ads.  
  
*   Services. Have users pay for one-time services such as voice transcription and for ongoing services such as access to a collection of data.  

You can’t use In-App Purchase to sell real-world goods and services or to sell unsuitable content.

*   Real-world goods and services. You must deliver a digital good or service within your app when using In-App Purchase. Use a different payment mechanism to let your users buy real-world goods and services in your app, such as a credit card or payment service.  

*   Unsuitable content. Don’t use In-App Purchase to sell content that the isn’t allowed by the App Review Guidelines—for example, pornography, hate speech, or defamation.  

在App Store上架指导中,给出了关于payment更具体的说明:

3.1 Payments  

3.1.1 In-App Purchase: If you want to unlock features or functionality within your app, (by way of example: subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use in-app purchase. Apps may not include buttons, external links, or other calls to action that direct customers to purchasing mechanisms other than IAP. Any credits or in-game currencies purchased via IAP must be consumed within the app and may not expire, and you should make sure you have a restore mechanism for any restorable in-app purchases. Please remember to assign the correct purchasability type or your app will be rejected. Apps should not directly or indirectly enable gifting of IAP content, features, or consumable items to others. Apps distributed via the Mac App Store may host plug-ins or extensions that are enabled with mechanisms other than the App Store.  

3.1.2 Subscriptions: Auto-renewing subscriptions should only be offered using in-app purchase and may only be used for periodicals (e.g. newspapers, magazines), business apps (e.g. enterprise, productivity, professional creative, cloud storage), media apps (e.g. video, audio, voice, photo sharing), and other approved services (e.g. dating, dieting, weather). These subscriptions must last a minimum of 7 days and be accessible from all of the user’s devices where the app is available. You may offer subscriptions that are shared across your own apps, but these subscriptions may not extend to third party apps or services.  

Note: We will update these guidelines in the coming weeks for the subscription changes launching this fall.

3.1.3 Content-based “Reader” Apps: Apps may allow a user to access previously purchased content or subscriptions (specifically: magazines, newspapers, books, audio, music, video, access to professional databases, VoIP, cloud storage, and approved services such as educational apps that manage student grades and schedules), provided the app does not direct users to a purchasing mechanism other than IAP.  

3.1.4 Content Codes: Apps may not use their own mechanisms to unlock content or functionality, such as license keys, augmented reality markers, QR codes, etc. In limited circumstances, such as when features are dependent upon specific hardware to function, the app may unlock that functionality without using in-app purchase (e.g. an astronomy app that adds features when synced with a telescope). App features that work in combination with an approved physical product (such as a toy) on an optional basis may unlock functionality without using IAP, provided that an IAP option is available as well. You may not, however, require users to purchase unrelated products or engage in advertising or marketing activities to unlock app functionality.  

3.1.5 Physical Goods and Services Outside of the App: If your app enables people to purchase goods or services that will be consumed outside of the app, you must use purchase methods other than IAP to collect those payments, such as Apple Pay or traditional credit card entry. Apps may facilitate transmission of approved virtual currencies (e.g. Bitcoin, DogeCoin) provided that they do so in compliance with all state and federal laws for the territories in which the app functions.  

3.1.6 Apple Pay: Apps using Apple Pay must provide all material purchase information to the user prior to sale of any good or service and must use Apple Pay branding and user interface elements correctly, as described in the Apple Pay Identity Guidelines and Human Interface Guidelines. Apps using Apple Pay to offer recurring payments must, at a minimum, disclose the following information:  

*   The length of the renewal term and the fact that it will continue until canceled
*   What will be provided during each period
*   The actual charges that will be billed to the customer
*   How to cancel

3.1.1开宗明义,If you want to unlock features or functionality within your app, (by way of example: subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use in-app purchase.,如果你想解锁你的应用程序内的特性或者功能,如订阅,游戏中的货币,游戏关卡,访问高级内容,或解锁完整版本,必须使用苹果内购.

总的来说,合法的虚拟物品和服务,如杂志,照片,订阅服务,游戏中的货币,游戏关卡,访问高级内容,或解锁完整版本,是允许并且应该使用内购的.

我们观察一下常用的App,优酷、网易云音乐、爱奇艺、腾讯视频,开通会员用的苹果内购,淘宝或京东购物没有用苹果内购,这和我们上面的认知是相符的.但我发现了特例:QQ充会员.然后又发现微信读书没用苹果内购,和它相似的多看阅读却用的苹果内购来充值,蒙了...

QQMemberCharge.png

知乎上的一个回答,给了解释的通的答案:

实际上是个解释权的问题,如果不同的苹果员工对不同的 Apps 把这两条解释出不同的意思,审核的结果就可能不一样。我们之前就这个问题专门询问过 Apple 的客服,他的回答是需要使用跨平台支付和同步功能的应用可以向苹果提出申请,如果申请通过了就可以了,虽然我从来没在苹果网站上找到过这个申请的入口在哪儿。

作者:吴畅
链接:https://www.zhihu.com/question/20665809/answer/15788162
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。  

最后不得不猜测:是不是因为QQ和微信读书,跟苹果的关系比较铁啊...

协议、税务和银行业务

App内购需要填写协议、税务和银行信息,这个流程我们大致走一下.

1.登录iTunes Connect
2.进入协议、税务和银行业务页面
ProtocolInterface.png
3.选择申请合同类型

进入协议、税务和银行业务页面后,会有3种合同类型,如果你之前没有主动申请过去合同,那么一般你现在激活的合同只有iOS Free Application一种.

页面内容分为两块:

  • Request Contracts(申请合同)
  • Contracts In Effect(已生效合同)

合同类型分为3种:

  • iOS Free Application(免费应用合同)
  • iOS Paid Application(付费应用合同)
  • iAd App NetNetwork(广告合同)
ContractRequest.png

苹果内购中,我们需要申请付费应用合同.

接下来,我们需要填写Contact Info(联系信息),Bank Info(银行信息), Tax Info(税费信息),点击下图中的蓝色按钮(SetUp)添加.

ContractSetup.png
4.联系信息
ContactInfoSetUp.png

如果你没有添加过联系人,你需要通过Add New Contact按钮来添加一个新的联系人。然后指定联系人的职务.如果有联系人,通过Select选择,其中联系人职务如下:

  • Senior Management:高管
  • Financial:财务
  • Technical:技术支持
  • Legal:法务
  • Marketing:市场推广

如果你是独立开发者,可以全部填你自己一个人.

5.填写银行信息
BankInfoSetUp.png

选择你的银行账户,如果你没有,点击旁边的Add Bank Account添加一个账户.

流程如下:

5-1 选择银行所在的国家

BankCountry.png

5-2 填写银行CNAPS Code

如果你不知道CNAPS Code是多少,可以点击Look up Transit Number来查询,查询时会根据3个关键信息来查询,如下:

  • Bank Name:银行的英文名称(不能是拼音)
  • City:银行所在的城市英文名称(中国的城市用拼音)
  • Postal Code:邮编
    然后在下面就会出来备选的银行,选择正确的银行后,点击next,进入下一步。
CNAPS.png
LookUpCNAPS.png

或者,通过网上查到的浙商银行来查询.

czbank.jpg

5-3 确认银行信息

ConfirmBankInfo.png

5-4 填写银行账号信息

  • Bank Account Number:银行账号
  • Confirm Bank Account Number:再次输入银行账号
  • Account Holder Name:持卡人姓名,中文名用拼写,名在前,姓在后
  • Bank Account Currency:货币类型,一般国内的开发者选择CNY
BankAccountInfo.png

5-5 确认所有信息

ConfirmInfo.png
6.填写税务信息

选择U.S Tax Forms来销售App.

TaxForm.png

选择后会问你两个问题,第一个问题如下:询问你是否是美国居民,有没有美国伙伴关系或者美国公司,如果没有直接选择No。

Q1.png

接下来第二个问题如下:询问你有没有在美国的商业性活动,没有也直接选No。

Q2.png

然后填写你的税务信息,包括以下几点:

ManageTaxInfo.png
  • Individual or Organization Name:个人或者组织名称
  • Country of incorporation: 所在国家
  • Type of Beneficial Owner:受益方式,独立开发者选个人
  • Permanent Residence:居住地址
  • Mailing address:邮寄地址
  • Name of Person Making this Declaration:声明人
  • Title:头衔
    填写完这些信息后就可以提交了.
7.等待审核

大约不到一天就会通过审核.

Processing.png

审核通过后变成以下状态:

Success.png

可以通过点击Edit或View来编辑或审阅.

创建内购项目

TouchMyApp.png
TouchTheProject.png
TouchInAppPurchase.png

添加适当的购买项目

IAPItme.png

不同的项目,处理逻辑各有差异.

一些共性的东西:

ProcudtID.png
language.png
screenshot.png

一些特殊要求:

privitePolicy.png
PrivitePolicyDemo.png

样例:

ItemDemo.png

苹果内购流程

IAPFlow.png

服务端的工作比较简单,分4步:

  1. 接收ios端发过来的购买凭证。

  2. 判断凭证是否已经存在或验证过,然后存储该凭证。

  3. 将该凭证发送到苹果的服务器验证,并将验证结果返回给客户端。

  4. 如果需要,修改用户相应的会员权限。

考虑到网络异常情况,服务器的验证应该是一个可恢复的队列,如果网络失败了,应该进行重试。

与苹果的验证接口文档在这里。简单来说就是将该购买凭证用Base64编码,然后POST给苹果的验证服务器,苹果将验证结果以JSON形式返回。

苹果AppStore线上的购买凭证验证地址是https://buy.itunes.apple.com/verifyReceipt
测试的验证地址是:https://sandbox.itunes.apple.com/verifyReceipt

下载源码

简单封装的内购源码
下载地址

我自己测试内购时源码(我在开发者账号上测试的这个项目,来真机调试,对看官应该没用)
下载地址

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 158,560评论 4 361
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,104评论 1 291
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,297评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,869评论 0 204
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,275评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,563评论 1 216
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,833评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,543评论 0 197
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,245评论 1 241
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,512评论 2 244
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,011评论 1 258
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,359评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,006评论 3 235
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,062评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,825评论 0 194
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,590评论 2 273
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,501评论 2 268

推荐阅读更多精彩内容

  • 参考链接iOS开发之内购-AppStore iOS App提交指南(二)-协议、税务和银行业务iOS应用内付费(I...
    sjzLovecj阅读 2,923评论 4 4
  • 公司项目中有虚拟产品,所以要使用苹果内购.自此记录一下苹果内购的流程.前提是已有开发者账号 协议,税务和银行业务 ...
    better栋阅读 1,963评论 0 7
  • 转载 公司项目中有虚拟产品,所以要使用苹果内购.自此记录一下苹果内购的流程.前提是已有开发者账号 协议,税务和银行...
    George2016阅读 1,250评论 9 6
  • 公司项目中有虚拟产品,所以要使用苹果内购.自此记录一下苹果内购的流程.前提是已有开发者账号 协议,税务和银行业务 ...
    看我的大白眼阅读 14,911评论 62 70
  • 壹 他从一个偏僻的小山村转学来到这所市重点中学。起初,就像一头森林里的小鹿闯进了歌剧院,他自己感到如芒在背手足无措...
    晴空月阅读 1,320评论 0 6