Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Markdown formatting #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -16,7 +16,7 @@ RMStore adds [blocks](#storekit-with-blocks) and [notifications](#notifications)
}];
```

##Installation
## Installation

Using [CocoaPods](http://cocoapods.org/):

Expand All @@ -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"]];
Expand All @@ -43,7 +43,7 @@ NSSet *products = [NSSet setWithArray:@[@"fabulousIdol", @"rootBeer", @"rubberCh
}];
```

###Add payment
### Add payment

```objective-c
[[RMStore defaultStore] addPayment:@"waxLips" success:^(SKPaymentTransaction *transaction) {
Expand All @@ -53,7 +53,7 @@ NSSet *products = [NSSet setWithArray:@[@"fabulousIdol", @"rootBeer", @"rubberCh
}];
```

###Restore transactions
### Restore transactions

```objective-c
[[RMStore defaultStore] restoreTransactionsOnSuccess:^(NSArray *transactions){
Expand All @@ -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:^{
Expand All @@ -73,19 +73,19 @@ 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];
...
[[RMStore defaultStore] removeStoreObserver:self];
```

###Products request notifications
### Products request notifications

```objective-c
- (void)storeProductsRequestFailed:(NSNotification*)notification
Expand All @@ -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.

Expand All @@ -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;
Expand All @@ -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:

Expand Down Expand Up @@ -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;
Expand All @@ -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:

Expand All @@ -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:

Expand All @@ -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:

Expand All @@ -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)

Expand Down