Skip to content

Commit

Permalink
Update the Documentation (#23)
Browse files Browse the repository at this point in the history
* Update the documentation

* Update `README.md`

* Update `CHANGELOG.md`
  • Loading branch information
ns-vasilev authored Feb 20, 2024
1 parent a120b99 commit 8fad3d3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

## [Unreleased]

## Fixed
- Update the documentation
- Fixed in Pull Request[#23](https://github.com/space-code/flare/pull/23).

#### 3.x Releases
- `3.0.0` Release Candidates - [`3.0.0-rc.1`](#300-rc1)

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Flare is a framework written in Swift that makes it easy for you to work with in
- [Installation](#installation)
- [Communication](#communication)
- [Contributing](#contributing)
- [Have a Question](#have-a-question)
- [Author](#author)
- [License](#license)

Expand All @@ -37,7 +38,7 @@ Check out the [flare documentation](https://space-code.github.io/flare/documenta

## Requirements
- iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ / visionOS 1.0+
- Xcode 14.0
- Xcode 15.0
- Swift 5.7

## Installation
Expand Down Expand Up @@ -67,6 +68,10 @@ make bootstrap

Please feel free to help out with this project! If you see something that could be made better or want a new feature, open up an issue or send a Pull Request!

## Have a Question?

Contact us via [issues on GitHub](https://github.com/space-code/flare/issues).

## Author
Nikita Vasilev, [email protected]

Expand Down
2 changes: 1 addition & 1 deletion Sources/Flare/Classes/Models/StoreProduct.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public final class StoreProduct: NSObject {
/// Protocol representing a Store Kit product.
let product: ISKProduct

/// <#Description#>
/// The store kit product.
var underlyingProduct: ISKProduct { product }

// MARK: Initialization
Expand Down
8 changes: 4 additions & 4 deletions Sources/Flare/Classes/Models/SubscriptionEligibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

import Foundation

// Enumeration defining the eligibility status for a subscription
/// Enumeration defining the eligibility status for a subscription
public enum SubscriptionEligibility: Int, Sendable {
// Represents that the subscription is eligible for an offer
/// Represents that the subscription is eligible for an offer
case eligible

// Represents that the subscription is not eligible for an offer
/// Represents that the subscription is not eligible for an offer
case nonEligible

// Represents that there is no offer available for the subscription
/// Represents that there is no offer available for the subscription
case noOffer
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ protocol IConfigurationProvider {
/// The application username.
var applicationUsername: String? { get }

/// <#Description#>
/// The cache policy for fetching data.
var fetchCachePolicy: FetchCachePolicy { get }

/// Configures the provider with the specified configuration settings.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Flare/Flare.docc/Articles/logging.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# logging
# Logging

Learn how to log important events.

Expand Down
13 changes: 10 additions & 3 deletions Sources/Flare/Flare.docc/Articles/perform-purchase.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Flare.shared.removeTransactionObserver()

The fetch method sends a request to the App Store, which retrieves the products if they are available. The productIDs parameter takes the product ids, which should be given from the App Store.

> important: Before attempting to add a payment always check if the user can actually make payments. The Flare does it under the hood, if a user cannot make payments, you will get an ``IAPError`` with the value ``IAPError/paymentNotAllowed``.
> important: Before attempting to add a payment always check if the user can actually make payments. The Flare does it under the hood, if a user cannot make payments, you will get an ``IAPError/paymentNotAllowed``.
```swift
Flare.shared.fetch(productIDs: ["product_id"]) { result in
Expand All @@ -42,7 +42,7 @@ Flare.shared.fetch(productIDs: ["product_id"]) { result in
}
```

Additionally, there are versions of both fetch that provide an `async` method, allowing the use of await.
Additionally, there is an `await` version of the ``IFlare/fetch(productIDs:)`` method.

```swift
do {
Expand All @@ -54,6 +54,14 @@ do {

> note: Products are cached by default. If caching is not possible for specific usecases, set ``Configuration/fetchCachePolicy`` to ``FetchCachePolicy/fetch``.
```swift
import Flare

let configuration = Configuration(fetchCachePolicy: .fetch)

Flare.configure(with: configuration)
```

## Purchasing Product

Flare provides a few methods to perform a purchase:
Expand Down Expand Up @@ -93,4 +101,3 @@ Flare.shared.finish(transaction: transaction, completion: nil)
```

> important: Don’t call the ``IFlare/finish(transaction:completion:)`` method before the transaction is actually complete and attempt to use some other mechanism in your app to track the transaction as unfinished. StoreKit doesn’t function that way, and doing that prevents your app from downloading Apple-hosted content and can lead to other issues.

0 comments on commit 8fad3d3

Please sign in to comment.