diff --git a/README.md b/README.md index 62fa551d..fbe3e556 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -#RMStore +# RMStore [![CocoaPods Version](https://cocoapod-badges.herokuapp.com/v/RMStore/badge.png)](http://cocoadocs.org/docsets/RMStore) [![Platform](https://cocoapod-badges.herokuapp.com/p/RMStore/badge.png)](http://cocoadocs.org/docsets/RMStore) [![Build Status](https://travis-ci.org/robotmedia/RMStore.png)](https://travis-ci.org/robotmedia/RMStore) @@ -16,7 +16,7 @@ RMStore adds [blocks](#storekit-with-blocks) and [notifications](#notifications) }]; ``` -##Installation +## Installation Using [CocoaPods](http://cocoapods.org/): @@ -28,11 +28,11 @@ Or add the files from the [RMStore](https://github.com/robotmedia/RMStore/tree/m Check out the [wiki](https://github.com/robotmedia/RMStore/wiki/Installation) for more options. -##StoreKit with blocks +## StoreKit with blocks RMStore adds blocks to all asynchronous StoreKit operations. -###Requesting products +### Requesting products ```objective-c NSSet *products = [NSSet setWithArray:@[@"fabulousIdol", @"rootBeer", @"rubberChicken"]]; @@ -43,7 +43,7 @@ NSSet *products = [NSSet setWithArray:@[@"fabulousIdol", @"rootBeer", @"rubberCh }]; ``` -###Add payment +### Add payment ```objective-c [[RMStore defaultStore] addPayment:@"waxLips" success:^(SKPaymentTransaction *transaction) { @@ -53,7 +53,7 @@ NSSet *products = [NSSet setWithArray:@[@"fabulousIdol", @"rootBeer", @"rubberCh }]; ``` -###Restore transactions +### Restore transactions ```objective-c [[RMStore defaultStore] restoreTransactionsOnSuccess:^(NSArray *transactions){ @@ -63,7 +63,7 @@ NSSet *products = [NSSet setWithArray:@[@"fabulousIdol", @"rootBeer", @"rubberCh }]; ``` -###Refresh receipt (iOS 7+ only) +### Refresh receipt (iOS 7+ only) ```objective-c [[RMStore defaultStore] refreshReceiptOnSuccess:^{ @@ -73,11 +73,11 @@ NSSet *products = [NSSet setWithArray:@[@"fabulousIdol", @"rootBeer", @"rubberCh }]; ``` -##Notifications +## Notifications RMStore sends notifications of StoreKit related events and extends `NSNotification` to provide relevant information. To receive them, implement the desired methods of the `RMStoreObserver` protocol and add the observer to `RMStore`. -###Adding and removing the observer +### Adding and removing the observer ```objective-c [[RMStore defaultStore] addStoreObserver:self]; @@ -85,7 +85,7 @@ RMStore sends notifications of StoreKit related events and extends `NSNotificati [[RMStore defaultStore] removeStoreObserver:self]; ``` -###Products request notifications +### Products request notifications ```objective-c - (void)storeProductsRequestFailed:(NSNotification*)notification @@ -100,7 +100,7 @@ RMStore sends notifications of StoreKit related events and extends `NSNotificati } ``` -###Payment transaction notifications +### Payment transaction notifications Payment transaction notifications are sent after a payment has been requested or for each restored transaction. @@ -127,7 +127,7 @@ Payment transaction notifications are sent after a payment has been requested or } ``` -###Restore transactions notifications +### Restore transactions notifications ```objective-c - (void)storeRestoreTransactionsFailed:(NSNotification*)notification; @@ -141,7 +141,7 @@ Payment transaction notifications are sent after a payment has been requested or } ``` -###Download notifications (iOS 6+ only) +### Download notifications (iOS 6+ only) For Apple-hosted and self-hosted downloads: @@ -188,7 +188,7 @@ Only for Apple-hosted downloads: } ``` -###Refresh receipt notifications (iOS 7+ only) +### Refresh receipt notifications (iOS 7+ only) ```objective-c - (void)storeRefreshReceiptFailed:(NSNotification*)notification; @@ -199,13 +199,13 @@ Only for Apple-hosted downloads: - (void)storeRefreshReceiptFinished:(NSNotification*)notification { } ``` -##Receipt verification +## Receipt verification RMStore doesn't perform receipt verification by default but provides reference implementations. You can implement your own custom verification or use the reference verifiers provided by the library. Both options are outlined below. For more info, check out the [wiki](https://github.com/robotmedia/RMStore/wiki/Receipt-verification). -###Reference verifiers +### Reference verifiers RMStore provides receipt verification via `RMStoreAppReceiptVerifier` (for iOS 7 or higher) and `RMStoreTransactionReceiptVerifier` (for iOS 6 or lower). To use any of them, add the corresponding files from [RMStore/Optional](https://github.com/robotmedia/RMStore/tree/master/RMStore/Optional) into your project and set the verifier delegate (`receiptVerifier`) at startup. For example: @@ -222,7 +222,7 @@ RMStore provides receipt verification via `RMStoreAppReceiptVerifier` (for iOS 7 If security is a concern you might want to avoid using an open source verification logic, and provide your own custom verifier instead. -###Custom verifier +### Custom verifier RMStore delegates receipt verification, enabling you to provide your own implementation using the `RMStoreReceiptVerifier` protocol: @@ -236,17 +236,17 @@ Call `successBlock` if the receipt passes verification, and `failureBlock` if it You will also need to set the `receiptVerifier` delegate at startup, as indicated above. -##Downloading content +## Downloading content RMStore automatically downloads Apple-hosted content and provides a delegate for a self-hosted content. -###Apple-hosted content +### Apple-hosted content Downloadable content hosted by Apple (`SKDownload`) will be automatically downloaded when purchasing o restoring a product. RMStore will notify observers of the download progress by calling `storeDownloadUpdate:` and finally `storeDownloadFinished:`. Additionally, RMStore notifies when downloads are paused, cancelled or have failed. RMStore will notify that a transaction finished or failed only after all of its downloads have been processed. If you use blocks, they will called afterwards as well. The same applies to restoring transactions. -###Self-hosted content +### Self-hosted content RMStore delegates the downloading of self-hosted content via the optional `contentDownloader` delegate. You can provide your own implementation using the `RMStoreContentDownloader` protocol: @@ -259,24 +259,24 @@ RMStore delegates the downloading of self-hosted content via the optional `conte Call `successBlock` if the download is successful, `failureBlock` if it isn't and `progressBlock` to notify the download progress. RMStore will consider that a transaction has finished or failed only after the content downloader delegate has successfully or unsuccessfully downloaded its content. -##Transaction persistence +## Transaction persistence RMStore delegates transaction persistence and provides two optional reference implementations for storing transactions in the Keychain or in `NSUserDefaults`. You can implement your transaction, use the reference implementations provided by the library or, in the case of non-consumables and auto-renewable subscriptions, get the transactions directly from the receipt. For more info, check out the [wiki](https://github.com/robotmedia/RMStore/wiki/Transaction-persistence). -##Requirements +## Requirements RMStore requires iOS 5.0 or above and ARC. -##Roadmap +## Roadmap RMStore is in initial development and its public API should not be considered stable. Future enhancements will include: * [Better OS X support](https://github.com/robotmedia/RMStore/issues/4) -##License +## License Copyright 2013-2014 [Robot Media SL](http://www.robotmedia.net)