Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOS In-App purchases

iOS In-App purchases

iOS In-App purchases overview and model

Avatar for Maxim Bolshakov

Maxim Bolshakov

March 01, 2013
Tweet

Other Decks in Technology

Transcript

  1. Overview §  Настраиваются в iTunes Connect §  Покупки регистрируются на

    AppID §  Покупки привязаны к UserID §  30% стоимости - в Apple §  Вывод денег – раз в месяц §  ~ $4.6 billion in-app покупок в играх за 2012-2016 §  $2.1 billion in-app покупок к 2011
  2. Restrictions & Guidelines §  No real-world sells §  Purchase must

    be available on all user devices (exception) §  Virtual currency is not allowed §  No defamation, hate speech, pornography or gambling §  Cannot be shared across apps or platforms §  Can download only additional content §  Hidden restore – bad way
  3. Consumables §  Purchased each time the user needs that § 

    Available on current device only §  Restored by custom server if needed
  4. Non-Consumables §  Purchased once per user §  Available on all

    registered devices §  Not expires §  Restored by iTunes
  5. Auto-Renewable Subscriptions §  Purchase access for a set duration time

    §  Available on all registered devices §  Automatically renew itself §  Episodic content §  Can be disabled §  Periods tacked by iTunes §  24 hours §  Not allowed in Israel
  6. Non-renewing Subscriptions §  Purchased for a set duration time § 

    Available on all registered devices §  Must offer access to non-episodic content §  Restored from custom server §  Custom expiration tracking
  7. Product types & In-App types guidelines Product In-App type Content

    Consumable, Non-Consumable Functionality Consumable, Non-Consumable Services Non-Consumable, Non-Renewing subscription Subscriptions Auto-Renewing, Non-Renewing, Free subscriptions
  8. Devices availability & Restore In-App type Restore required Restore mechanism

    Device availability Consumable No Custom server One or all Non-consumable Yes iTunes All Non-renewing Subscriptions Yes Custom server All Auto-Renewing Subscriptions Yes iTunes All Free Subscriptions Yes iTunes All
  9. Settings iTunes Connect §  Valid, approved bank information §  Contract

    “iOS Paid Applications” iOS Provisioning portal §  AppID with enabled “In-App Purchases” §  Updated provisioning profile iTunes Connect §  Create In-App
  10. Important §  “Cleared for Sale” checkbox §  Screenshots §  Test-users

    §  In-App “approvement”: 3 - 24 hours §  Can be tested in simulator §  No binaries needed
  11. Built-in product model Pros: •  Easy •  Secure •  24/7

    Cons: •  Non-renewing subscriptions •  Can’t restore consumable purchases •  Must change binaries if list of purchases or product content changed
  12. Server product model Pros: •  List of purchases can be

    changed outside •  Content management •  Non-renewing subscriptions •  Consumable purchases restoring Cons: •  A lot of additional work •  Secure issues
  13. SKPaymentTransactionObserver §  UpdatedTransactions(…) •  TransactionState.Purchasing •  TransactionState.Purchased •  TransactionState.Failed • 

    TransactionState.Restored §  PaymentQueueRestoreCompletedTransactionsFinished(…) §  RestoreCompletedTransactionsFailedWithError(…)
  14. Verification https://(sandbox|buy).itunes.apple.com/verifyReceipt Request §  JSON – “receipt data”, (“password”) § 

    Base64 encoding Response §  JSON – “status”, “receipt”, (“latest_receipt”, “latest_receipt_info”) §  Status “0” - OK
  15. Hosted content §  Root folder contains •  ContentInfo.plist •  folder

    Contents §  Size limited – 2Gb §  ContentInfo.plist •  Content version •  IAPProductIdentifier
  16. Hosted content §  XCode project template §  Create new XCode

    project §  Fill product id & version §  Add files §  Archive §  Upload to iTunesConnect
  17. In-App Content Display & Purchasing §  App store interface from

    within app §  SKStoreProductViewController •  StoreProductParameters
  18. Links §  In-App Purchase Programming Guide http://bit.ly/YKDxXw §  Verification manager

    http://bit.ly/ZEBLWO §  Xamarin sample http://bit.ly/XdAOFX §  iOS 6 StoreKit changes http://bit.ly/VQMe1s §  In-App purchases: A Full walkthrough http://bit.ly/YKFbs3 §  git: iOS InAppManager http://bit.ly/13qIOal
  19. ?