implementing in-app purchases on ios
DESCRIPTION
Implementing In-App Purchases on iOS. Christina Moulton Teak Mobile Inc Teakmobile.com @ ChristinaMltn. How?. App Store Set up App Add items In App Purchase Restore S erver? MKStoreKit. Decisions. Price? Business Model Consumable Non-Consumable Subscription (auto-renew?) - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/1.jpg)
Implementing In-App Purchases on iOS
Christina MoultonTeak Mobile IncTeakmobile.com@ChristinaMltn
![Page 2: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/2.jpg)
![Page 3: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/3.jpg)
How?• App Store–Set up App–Add items
• In App–Purchase–Restore–Server?–MKStoreKit
![Page 4: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/4.jpg)
Decisions• Price?• Business Model–Consumable–Non-Consumable– Subscription (auto-renew?)
• Content Delivery–Compiled in– Your server–Apple Hosted
![Page 5: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/5.jpg)
Rules• Reviewed like apps• Must use Apple’s API• Only virtual goods• No intermediate currency• Subscriptions: Minimum 7 days, all devices• Can’t sell access to camera, gyroscope, etc.• Auto-renewing subscriptions only for periodicals,
biz or media apps
See https://developer.apple.com/appstore/resources/approval/guidelines.html
![Page 6: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/6.jpg)
Set Up: App & Products1. Create Explicit App ID in iOS
Provisioning Portal2. Create App in iTunesConnect3. Add Product(s) in iTunesConnect
![Page 7: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/7.jpg)
![Page 8: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/8.jpg)
Used for auto-renewing
subscriptions
![Page 9: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/9.jpg)
Implementation: Requirements• Transaction completion went app interrupted• Track # of consumables• Restore non-consumables on multiple devices• Remember purchases securely (Keychain)• Remember non-renewing subscriptions• Validate of auto-renewing subscriptions on each
launch (latest purchase date)• Deliver content (check receipts on your server)• Localized prices and descriptions
![Page 10: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/10.jpg)
Implementation: MKStoreKit Pt.1• https://github.com/MugunthKumar/MKStoreKit• Add MKStoreKit to project• Add Security and StoreKit Frameworks• Init in app delegate:
[MKStoreManager sharedManager];• Configure Plist• (If renewable, add shared secret to
MKStoreKitConfigs.h)
![Page 11: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/11.jpg)
Implementation: MKStoreKit Pt.2• Implement purchase[[MKStoreManager sharedManager] buyFeature:kFeatureAId onComplete:^(NSString* purchasedFeature, NSData* purchasedReceipt, NSArray* downloads) { NSLog(@"Purchased: %@", purchasedFeature); } onCancelled:^ { NSLog(@"User Cancelled Transaction"); }];
• (If auto-renewing, setup expiry notifications)• Pull data from App Store to populate UI• Implement restoring purchases
![Page 12: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/12.jpg)
Implementation: Testing• Test User Account in iTunesConnect• Banking & tax contracts must be set up• Other than hosted content, can use simulator• Sandbox can be slow
![Page 13: Implementing In-App Purchases on iOS](https://reader035.vdocuments.mx/reader035/viewer/2022062218/56816238550346895dd26914/html5/thumbnails/13.jpg)
Resources• Demo Project: https://github.com/cmoulton/ioskwiap• MKStoreKit: https://github.com/MugunthKumar/MKStoreKit• Intro to MKStoreKit:
http://blog.mugunthkumar.com/coding/using-mkstorekit-in-your-apps/
• App Store Review Guidelines: https://developer.apple.com/appstore/resources/approval/guidelines.html
• Based on iOS 5 Programming: Pushing the Limits, ch. 14: Selling Past the Sale with In App Purchases http://www.amazon.ca/iOS-Programming-Pushing-Limits-Extraordinary/dp/1119961327