Skip to content

Commit

Permalink
Merge branch 'master' into swift6
Browse files Browse the repository at this point in the history
  • Loading branch information
takecian committed Nov 3, 2024
2 parents 68f022a + 62abd32 commit e7ecf5a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
4 changes: 1 addition & 3 deletions Demo/Demo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class ViewController: UIViewController {

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
SwiftRater.incrementSignificantUsageCount()
// If you want to meet the condition for testing purpose, use this.
// SwiftRater.debugMode = true
SwiftRater.incrementSignificantUsageCount(point: 1)
SwiftRater.check(host: self)

// If your want to show rating dialog manually, use `rateApp()`.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ You can set properties you want to apply.
| :------------- |:-------------|
| debugMode | Shows review request every time. Default false, **need to set false when you submit app to AppStore**. |
| conditionsMetMode | Possible values: `.any`, `.all` (default)<br /> Setting this to `.any` allows the prompt to be shown **when any one or more of your criteria have been met**. |
| showLaterButton | Show Later button in review request dialong, valid for iOS10.2 or before devices.|
| showLaterButton | Show Later button in review request dialog, valid for iOS10.2 or before devices.|
| daysBeforeReminding | Days until reminder popup if the user chooses `rate later`, valid for iOS10.2 or before devices. |

2.Call `SwiftRater.check()` in `viewDidAppear` of ViewController where you want to show review request dialog. If conditions are met, SwiftRater will show review request popup.
Expand Down Expand Up @@ -168,7 +168,7 @@ SwiftRater.daysBeforeReminding = 7
SwiftRater.appLaunched()
```

If you wanted to show the rquest after a user performs 10 significant actions before 5 days or 5 uses have passed:
If you wanted to show the request after a user performs 10 significant actions before 5 days or 5 uses have passed:

```
SwiftRater.conditionsMetMode = .any
Expand Down
4 changes: 2 additions & 2 deletions SwiftRater.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

Pod::Spec.new do |s|
s.name = 'SwiftRater'
s.version = '2.1.2'
s.version = '2.1.3'
s.summary = 'A utility that reminds your iPhone app users to review the app written in pure Swift.'
s.platform = :ios, '11.0'
s.platform = :ios, '12.0'

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
Expand Down
10 changes: 3 additions & 7 deletions SwiftRater/SwiftRater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ import StoreKit
SwiftRater.shared.perform()
}

@objc public static func incrementSignificantUsageCount() {
UsageDataManager.shared.incrementSignificantUseCount()
@objc public static func incrementSignificantUsageCount(point: Int = 1) {
UsageDataManager.shared.incrementSignificantUseCount(point: point)
}

#if os(iOS)
Expand Down Expand Up @@ -489,11 +489,7 @@ import StoreKit
private func incrementUsageCount() {
UsageDataManager.shared.incrementUseCount()
}

private func incrementSignificantUseCount() {
UsageDataManager.shared.incrementSignificantUseCount()
}


#if os(iOS)
private func showRatingAlert(host: UIViewController?, force: Bool) {
NSLog("[SwiftRater] Trying to show review request dialog.")
Expand Down
4 changes: 2 additions & 2 deletions SwiftRater/UsageDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ class UsageDataManager: @unchecked Sendable {
usesCount = usesCount + 1
}

func incrementSignificantUseCount() {
significantEventCount = significantEventCount + 1
func incrementSignificantUseCount(point: Int = 1) {
significantEventCount = significantEventCount + point
}

func saveReminderRequestDate() {
Expand Down

0 comments on commit e7ecf5a

Please sign in to comment.