寫在前面:我這篇文章並不是講怎么做內購的,是我在做內購時,覺得很難理解它的設計,才有了這篇文章。
一、內購類型
蘋果官方文檔解釋
Consumables Consumables are In-App Purchases that must be purchased each time the user needs that item. Consumable In-App Purchases are available for both iOS and OS X apps. • Supplies in a game (ammunition, health points, cheats, extra lives, etc) • Accelerators used to decrease advancement time within an app 消耗品:用戶每次使用時都需要購買; • 游戲中的補給品,比如生命值等等; • 縮短晉級時間的加速器。 Non-Consumables Non-Consumables are In-App Purchases that only need to be purchased once by the user and are available to all devices registered to a user. This purchase type is used for services that do not expire. Non-Consumable In-App Purchases are available for both iOS and OS X apps. • Additional levels within a game • Access to pro-features such as additional camera lenses or audio effects • Lifetime subscription to a service • Books and individual magazine issues 非消耗品:用戶只需要購買一次,在任何設備上登錄該賬戶,都可以使用該商品。 • 游戲中額外的關卡; • 付費功能,比如相機應用中的付費濾鏡等。 Auto-Renewable Subscriptions Auto-Renewable Subscriptions allow the user to purchase episodic content or access to dynamic digital content for a set duration time. At the end of each duration, the subscription will renew itself, until a user opts out. The Auto-Renewable Subscription In-App Purchase type is available for both iOS and OS X apps. • Recurring delivery of newspapers or magazine issues • Monthly subscription to audio or video streaming feed • Weekly membership to a dating service • Business app providing cloud storage services 自動訂閱:用戶在特定時間段內可以獲取到指定的內容。並且,在指定時間段即將結束時,自動訂閱。 • 報紙雜志訂閱等。 Free Subscriptions Free Subscriptions are an extension of Auto-Renewable Subscriptions that permit the delivery of free subscription content to Newsstand-enabled applications. The Free Subscription In-App Purchase type is implemented in the same way as an Auto-Renewable Subscription, just without any charges to the user. Free Subscriptions do not have expirations, but the user can turn off the subscription at any time. 免費自動訂閱:是“自動訂閱”類型的擴展,比起“自動訂閱”,差別在於免費。該類型是不會過期的,除非用戶手動關掉。 Non-Renewing Subscriptions Non-Renewing Subscription allow the sale of services with a limited duration. Non-Renewing Subscriptions must be used for In-App Purchases that offer time-based access to static content and are only available for both iOS and OS X apps. • One week subscription to voice guidance feature within a navigation app • Annual subscription to online catalog of archived video or audio 非自動續訂:需要用戶手動再次購買的,基於時間的商品類型。 • 導航類app中,語音導航功能一周的使用權利等。
我的理解:
二、為什么這樣分類
不知道大家有沒有很奇怪,蘋果為什么要給自己找麻煩,如果就像微信支付,支付寶支付一樣,只負責支付,給憑證就可以了嘛。
蘋果給開發者一套規范,開發者總可以找到自己商品適合的商品類型,開發者開發時要遵守該類型的規范。
三、內購恢復及同步
同步都是由app主動發起的,有些需要系統配合,通過恢復購買記錄來完成(類型2、3、4);有些完全由app單獨完成(類型5);有些不需要同步(類型1)。
消耗品(1)
不需要帳號間同步,用戶1在iPhone上購買了消耗品后,在iPad上登錄,不需要同步購買過的消耗品。
非消耗品(2)自動訂閱(3)免費自動訂閱(4)
app中應該有機制讓用戶可以恢復他們的購買記錄,比如一個恢復購買按鈕。恢復購買記錄是提示用戶的應用商店的憑據,從而中斷你的應用程序流程,因此不要自動恢復購買記錄,特別是在每次應用程序啟動時。
非自動訂閱(5)
app記錄購買記錄並同步
為什么要恢復內購
個人觀點:內購設計的假設條件是,app中沒有賬戶系統。