瀏覽代碼

Add table of contents to Readme

Andrea Bizzotto 7 年之前
父節點
當前提交
9a77e49f48
共有 1 個文件被更改,包括 86 次插入48 次删除
  1. 86 48
      README.md

+ 86 - 48
README.md

@@ -22,10 +22,80 @@ I started [**Sustainable Earth**](https://github.com/bizz84/Sustainable-Earth),
 
 ### Like SwiftyStoreKit? Please consider [becoming a Patron](https://www.patreon.com/biz84).
 
+## Content
+
+- [Installation](#installation)
+	- [CocoaPods](#cocoapods)
+	- [Carthage](#carthage)
+- [Features](#features)
+- [Contributing](#contributing)
+- [App startup](#app-startup)
+	- [Complete Transactions](#complete-transactions)
+- [Purchases](#purchases)
+	- [Retrieve products info](#retrieve-products-info)
+	- [Purchase a product (given a product id)](#purchase-a-product-given-a-product-id)
+	- [Purchase a product (given a SKProduct)](#purchase-a-product-given-a-skproduct)
+	- [Should add store payment handling (iOS 11)](#should-add-store-payment-handling-iOS-11)
+	- [Restore previous purchases](#restore-previous-purchases)
+	- [Downloading content hosted with Apple](#downloading-content-hosted-with-apple)
+- [Receipt verification](#receipt-verification)
+	- [Retrieve local receipt (encrypted)](#retrieve-local-receipt-encrypted)
+	- [Fetch receipt (encrypted)](#fetch-receipt-encrypted)
+	- [Verify Receipt](#verify-receipt)
+- [Verifying purchases and subscriptions](#verifying-purchases-and-subscriptions)
+	- [Verify Purchase](#verify-purchase)
+	- [Verify Subscription](#verify-subscription)
+	- [Subscription Groups](#subscription-groups)
+- [Change Log](#change-log)
+- [Notes](#notes)
+- [Sample Code](#sample-code)
+- [Video Tutorials](#video-tutorials)
+- [Essential Reading](#essential-reading)
+	- [Troubleshooting](#troubleshooting)
+- [Payment flows - implementation details](#payment-flows--implementation-details)
+- [Credits](#credits)
+- [Apps using SwiftyStoreKit](#apps-using-swiftystorekit)
+- [License](#license)
+	
+## Installation
+
+### CocoaPods
+
+SwiftyStoreKit can be installed as a [CocoaPod](https://cocoapods.org/) and builds as a Swift framework. To install, include this in your Podfile.
+
+```ruby
+use_frameworks!
+
+pod 'SwiftyStoreKit'
+```
+Once installed, just ```import SwiftyStoreKit``` in your classes and you're good to go.
+
+### Carthage
+
+To integrate SwiftyStoreKit into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile:
+
+```ogdl
+github "bizz84/SwiftyStoreKit"
+```
+
+**NOTE**: Please ensure that you have the [latest](https://github.com/Carthage/Carthage/releases) Carthage installed.
+
+## Features
+
+- Super easy to use block based API
+- Support for consumable, non-consumable in-app purchases
+- Support for free, auto-renewable and non-renewing subscriptions
+- Support for in-app purchases started in the App Store (iOS 11)
+- Remote receipt verification
+- Verify purchases, subscriptions, subscription groups
+- Downloading content hosted with Apple
+- iOS, tvOS and macOS compatible
+
 ## Contributing
 
 #### Got issues / pull requests / want to contribute? [Read here](CONTRIBUTING.md).
 
+
 ## App startup
 
 ### Complete Transactions
@@ -554,30 +624,7 @@ SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in
 ## Notes
 The framework provides a simple block based API with robust error handling on top of the existing StoreKit framework. It does **NOT** persist in app purchases data locally. It is up to clients to do this with a storage solution of choice (i.e. NSUserDefaults, CoreData, Keychain).
 
-## Installation
-
-### CocoaPods
-
-SwiftyStoreKit can be installed as a [CocoaPod](https://cocoapods.org/) and builds as a Swift framework. To install, include this in your Podfile.
-
-```ruby
-use_frameworks!
-
-pod 'SwiftyStoreKit'
-```
-Once installed, just ```import SwiftyStoreKit``` in your classes and you're good to go.
-
-### Carthage
-
-To integrate SwiftyStoreKit into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile:
-
-```ogdl
-github "bizz84/SwiftyStoreKit"
-```
-
-**NOTE**: Please ensure that you have the [latest](https://github.com/Carthage/Carthage/releases) Carthage installed.
-
-## Swift 2.x / 3.x / 4.x
+#### Swift 2.x / 3.x / 4.x
 
 | Language  | Branch | Pod version | Xcode version |
 | --------- | ------ | ----------- | ------------- |
@@ -586,34 +633,15 @@ github "bizz84/SwiftyStoreKit"
 | Swift 2.3 | [swift-2.3](https://github.com/bizz84/SwiftyStoreKit/tree/swift-2.3) | 0.4.x | Xcode 8, Xcode 7.3.x |
 | Swift 2.2 | [swift-2.2](https://github.com/bizz84/SwiftyStoreKit/tree/swift-2.2) | 0.3.x | Xcode 7.3.x |
 
+
 ## Change Log
 
-See the [Releases Page](https://github.com/bizz84/SwiftyStoreKit/releases)
+See the [Releases Page](https://github.com/bizz84/SwiftyStoreKit/releases).
 
 ## Sample Code
 The project includes demo apps [for iOS](https://github.com/bizz84/SwiftyStoreKit/blob/master/SwiftyStoreKit-iOS-Demo/ViewController.swift) [and macOS](https://github.com/bizz84/SwiftyStoreKit/blob/master/SwiftyStoreKit-macOS-Demo/ViewController.swift) showing how to use SwiftyStoreKit.
 Note that the pre-registered in app purchases in the demo apps are for illustration purposes only and may not work as iTunes Connect may invalidate them.
 
-#### Features
-
-- Super easy to use block based API
-- Support for consumable, non-consumable in-app purchases
-- Support for free, auto renewable and non renewing subscriptions
-- Receipt verification
-- iOS, tvOS and macOS compatible
-
-
-## Video Tutorials
-
-#### Jared Davidson: In App Purchases! (Swift 3 in Xcode : Swifty Store Kit)
-
-<a href="https://www.youtube.com/watch?v=dwPFtwDJ7tcb"><img src="https://raw.githubusercontent.com/bizz84/SwiftyStoreKit/master/Screenshots/VideoTutorial-JaredDavidson.jpg" width="854" /></a>
-
-#### [@rebeloper](https://github.com/rebeloper): Ultimate In-app Purchases Guide
-
-<a href="https://www.youtube.com/watch?v=bIyj6BZ1-Qw&list=PL_csAAO9PQ8b9kqrltk2_SpYslTwyrwjb"><img src="https://raw.githubusercontent.com/bizz84/SwiftyStoreKit/master/Screenshots/VideoTutorial-Rebeloper.jpg" width="854" /></a>
-
-
 ## Essential Reading
 * [Apple - WWDC16, Session 702: Using Store Kit for In-app Purchases with Swift 3](https://developer.apple.com/videos/play/wwdc2016/702/)
 * [Apple - TN2387: In-App Purchase Best Practices](https://developer.apple.com/library/content/technotes/tn2387/_index.html)
@@ -641,7 +669,17 @@ I have also written about building SwiftyStoreKit on Medium:
 * [Testing Auto-Renewable Subscriptions on iOS](http://davidbarnard.com/post/164337147440/testing-auto-renewable-subscriptions-on-ios)
 * [Apple forums - iOS 11 beta sandbox - cannot connect to App Store](https://forums.developer.apple.com/message/261428#261428)
 
-## Payment flows - implementation Details
+## Video Tutorials
+
+#### Jared Davidson: In App Purchases! (Swift 3 in Xcode : Swifty Store Kit)
+
+<a href="https://www.youtube.com/watch?v=dwPFtwDJ7tcb"><img src="https://raw.githubusercontent.com/bizz84/SwiftyStoreKit/master/Screenshots/VideoTutorial-JaredDavidson.jpg" width="854" /></a>
+
+#### [@rebeloper](https://github.com/rebeloper): Ultimate In-app Purchases Guide
+
+<a href="https://www.youtube.com/watch?v=bIyj6BZ1-Qw&list=PL_csAAO9PQ8b9kqrltk2_SpYslTwyrwjb"><img src="https://raw.githubusercontent.com/bizz84/SwiftyStoreKit/master/Screenshots/VideoTutorial-Rebeloper.jpg" width="854" /></a>
+
+## Payment flows - implementation details
 In order to make a purchase, two operations are needed:
 
 - Perform a `SKProductRequest` to obtain the `SKProduct` corresponding to the product identifier.
@@ -650,7 +688,7 @@ In order to make a purchase, two operations are needed:
 
 The framework takes care of caching SKProducts so that future requests for the same `SKProduct` don't need to perform a new `SKProductRequest`.
 
-### Payment queue
+#### Payment queue
 
 The following list outlines how requests are processed by SwiftyStoreKit.
 
@@ -700,7 +738,7 @@ A full list of apps is published [on AppSight](https://www.appsight.io/sdk/57415
 
 ## License
 
-Copyright (c) 2015-2017 Andrea Bizzotto bizz84@gmail.com
+Copyright (c) 2015-2018 Andrea Bizzotto bizz84@gmail.com
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: