A utility that reminds your iPhone app's users to review the app written in pure Swift.

Related tags

Utility SwiftRater
Overview

SwiftRater

Version License Platform Build Status codebeat badge

SwiftRater is a class that you can drop into any iPhone app that will help remind your users to review your app on the App Store/in your app.

SwiftRater is written in pure Swift.

iOS 10.3 〜

SwiftRater1

For iOS 10.3 devices, SwiftRater uses SKStoreReviewController.

〜 iOS 10.2

SwiftRater2

Requirements

iOS 8.0 or later, written in Swift. Xcode 8.2 or later.

Installation

Cocoapods

SwiftRater is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SwiftRater"

Carthage

SwiftRater is compatible with Carthage. Add it to your Cartfile:

github "takecian/SwiftRater"

Usage

1.Setup SwiftRater in AppDelegate.swift. After setting up, call SwiftRater.appLaunched().

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        SwiftRater.daysUntilPrompt = 7
        SwiftRater.usesUntilPrompt = 10
        SwiftRater.significantUsesUntilPrompt = 3
        SwiftRater.daysBeforeReminding = 1
        SwiftRater.showLaterButton = true
        SwiftRater.debugMode = true
        SwiftRater.appLaunched()

        return true
    }

Property Description
daysUntilPrompt Shows review request if daysUntilPrompt days passed since first app launch.
usesUntilPrompt Shows review request if users launch more than usesUntilPrompt times.
significantUsesUntilPrompt Shows review request if user does significant actions more than significantUsesUntilPrompt

You can set properties you want to apply.

Property Description
debugMode Shows review request every time. Default false, need to set false when you submit app to AppStore.
showLaterButton Show Later button in review request dialong, 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.

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        SwiftRater.check()
    }

3(Optional).For significantUsesUntilPrompt, you need to add SwiftRater.incrementSignificantUsageCount in siginificant action for your app.

func postComment() {
    // do something ..

	SwiftRater.incrementSignificantUsageCount()
}

4(Optional).Call SwiftRater.rateApp(host:) to let your users to review your app on the App Store/in your app directly.

func rateButtonDidClick(sender: UIButton) {
    // do something ..

	SwiftRater.rateApp(host: self)
}

Example

This example states that the rating request is only shown when the app has been launched 5 times and after 7 days, remind 5 days after if later selected.

SwiftRater.daysUntilPrompt = 7
SwiftRater.usesUntilPrompt = 5
SwiftRater.daysBeforeReminding = 5
SwiftRater.appLaunched()

If you wanted to show the request after 5 days only and remind 7 days after if later selected, you can set the following:

SwiftRater.daysUntilPrompt = 5
SwiftRater.daysBeforeReminding = 7
SwiftRater.appLaunched()

Customize text

You can customize text in review request dialog for iOS10.2 or before devices. Set text in following properties.

  • SwiftRater.alertTitle
  • SwiftRater.alertMessage
  • SwiftRater.alertCancelTitle
  • SwiftRater.alertRateTitle
  • SwiftRater.alertRateLaterTitle
  • SwiftRater.appName

Country code

If your app is only avaiable for some coutnries, please add country code at Setup phase.

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        SwiftRater.daysUntilPrompt = 7
        SwiftRater.usesUntilPrompt = 10

        SwiftRater.countryCode = "fr"

        SwiftRater.debugMode = true
        SwiftRater.appLaunched()
        return true
    }

App ID

Optional, you can set App ID explicitly. If not, SwiftRater will get App ID from appstore by bundle ID.

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        SwiftRater.daysUntilPrompt = 7
        SwiftRater.usesUntilPrompt = 10

        SwiftRater.appID = "1104775712"

        SwiftRater.debugMode = true
        SwiftRater.appLaunched()
        return true
    }

Demo

You can find Demo app in this repo.

Author

takecian, [email protected]

License

SwiftRater is available under the MIT license. See the LICENSE file for more info.

Comments
  • Significant event trigger

    Significant event trigger

    Hi

    Does this framework fallback to the new iOS 10 rating api / rules? Awesome I see that it does.

    Does it support uialertcontroller?

    Also when say 5 significant events occur, can the rating dialog be shown instantly regardless of days or uses ?

    Thanks

    Jules.

    opened by JulesMoorhouse 24
  • What happens when display limit is reached?

    What happens when display limit is reached?

    On Apple's developer documentation for SKStoreReviewController it says "the prompt will only be displayed to a user a maximum of three times within a 365-day period".

    What is the procedure with this? - say if you call SwiftRater.rateApp() does it just take the user to the app's page on the App Store rather than showing the prompt?

    opened by TomWFox 12
  • No known class method for selector 'incrementSignificantUsageCount'

    No known class method for selector 'incrementSignificantUsageCount'

    Hi,

    I'm using SwiftRater with Objective C. I've just updated my pods from 0.2.1 to 1.1.0.

    Now I'm getting an error.

    No known class method for selector 'incrementSignificantUsageCount'

    This is how I'm calling the method

    [SwiftRater incrementSignificantUsageCount];

    I've looked at the SwiftRater Code and I can see that, that methods is public.

    I'm not that familiar with Swift, can you advise please.

    Thanks.

    opened by JulesMoorhouse 11
  • Issue useing SwiftRater.check()

    Issue useing SwiftRater.check()

    When I click on button to show RatingView, it logs me but nothing prompts

     [SwiftRater]  will check daysUntilPrompt
     [SwiftRater]  will check usesUntilPrompt
    

    My code is

     SwiftRater.reset()
     DispatchQueue.main.async {
            SwiftRater.check()
      }
    
    opened by BhavinBhadani 10
  • Feature Request: App title parameter

    Feature Request: App title parameter

    Hi

    I would like request an app title parameter.

    I know you can change all the strings, but then you loose the benefit of the localizations.

    I would you also use this in my other apps next update.

    PS. Once live the issues I had about the 10.3 api seemed fine.

    Good job!

    opened by JulesMoorhouse 9
  • iTunes lookup api returns empty list

    iTunes lookup api returns empty list

    Hi,

    The iTunes lookup api returns empty list. If I try to add country code in url then it works. My bundle Id is good.

    Doesn't work : https://itunes.apple.com/lookup?bundleId=xxxxx works : https://itunes.apple.com/fr/lookup?bundleId=xxxxx

    Any idea about that ?

    Thanks

    opened by NameX44 5
  • Pops up everytime

    Pops up everytime

    Hi, the dialog pops up from the first launch even if debug is false and in real device. Swift 4. iOS: 11.3. XCode 10.1 My Settings: SwiftRater.daysUntilPrompt = 3 SwiftRater.usesUntilPrompt = 1 SwiftRater.significantUsesUntilPrompt = 2 SwiftRater.daysBeforeReminding = 2

    opened by HelloDev18 5
  • Submit button hook up

    Submit button hook up

    Hi there, first nice job on making this pure swift...much easier and lightweight vs. Armchair.

    Please can you fully detail and explain how we get the action implemented for the submit button please? For example it is greyed out and disabled. The current explanation and documentation for how to have this submit direct to App Store is not complete.

    Appreciated

    opened by karmsingh 4
  • node is produced by multiple commands

    node is produced by multiple commands

    fix podspec to avoid issue with new xcode build system: … 👎 unable to build node: '.../SwiftRater/SwiftRater.framework/Info.plist' (node is produced by multiple commands;

    opened by krezzoid 4
  • App Store Connect Operation Error Invalid Bundle. The bundle at 'BalGuide.app/Frameworks/SwiftRater.framework' contains disallowed file 'Frameworks'.

    App Store Connect Operation Error Invalid Bundle. The bundle at 'BalGuide.app/Frameworks/SwiftRater.framework' contains disallowed file 'Frameworks'.

    I'm getting the following error when I upload to the app store

    App Store Connect Operation Error Invalid Bundle. The bundle at 'BalGuide.app/Frameworks/SwiftRater.framework' contains disallowed file 'Frameworks'.

    opened by JulesMoorhouse 3
  • Triggering the control doesn't work on iOS12

    Triggering the control doesn't work on iOS12

    Hey, first of all thank you for your work.

    We implemented your class into our project and it works just fine for iOS10 and iOS11, but on the latest iOS12 beta the control is not shown when trying to access it (we implemented it when user taps a link).

    Are you aware of this issue? Is there anything that I can help you with to fix this and be prepared for when iOS12 is coming out?

    Thanks, Alex.

    opened by alexppmax 3
  • SwiftUI Support

    SwiftUI Support

    Hey,

    I've used SwiftRater in other older apps in the past, Objective C apps, I've found it works really well.

    I'd really like to use this with SwiftUI now.

    Jules.

    opened by JulesMoorhouse 1
  • Project Issue: found 1 file(s) which are unhandled

    Project Issue: found 1 file(s) which are unhandled

    I get following project issue in Xcode 12.4

    Resolve Package Graph Warning:

    found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target.

    opened by Adobels 3
  • Use of check()

    Use of check()

    After calling incrementSignificantUsageCount() do we need to call check() ?

    For example:

    @objc func didTapSave(_ sender: UIBarButtonItem) {
        SwiftRater.incrementSignificantUsageCount()
        SwiftRater.check()
    }
    
    opened by UlanNurmatov 0
  • Hope to add features

    Hope to add features

    Thank you very much for providing such an excellent tool

    1. Hope to support OSX.
    2. Hope private func rateAppWithAppStore() can remove "private". After all, many useful programs have manual clicks to write reviews. Then the method can be called directly from the outside,

    Best wishes!

    opened by luoxiao 0
  • IMPROVEMENT

    IMPROVEMENT

    Hi, thanks for your library, can you add a completion handler when user did a review? because for now we cannot know if he canceled or not..

    Thanks :)

    opened by ghost 1
  • SwiftRater.incrementSignificantUsageCount() not triggering rating prompt

    SwiftRater.incrementSignificantUsageCount() not triggering rating prompt

    Hello, and thanks for the library! Everything works great in debug mode, but I can't seem to get the rating prompt to appear when using SwiftRater.incrementSignificantUsageCount(). I've used it to try to trigger a rating prompt after the third time a uses a tap gesture in my interface, but no prompt is appearing while testing. Any ideas why?

        SwiftRater.daysUntilPrompt = 3
        SwiftRater.usesUntilPrompt = 3
        SwiftRater.significantUsesUntilPrompt = 3
        SwiftRater.daysBeforeReminding = 2
        SwiftRater.showLaterButton = true
        // Set to false before submitting to App Store!!!!
        SwiftRater.debugMode = false
        SwiftRater.appLaunched()
            
        return true
        }
    
    opened by mozltovcoktail 5
Releases(2.1.0)
Owner
Takeshi Fujiki
Takeshi Fujiki
RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) Track your location and send your logs to RNH Regatta :-)

RNH Tracker for iOS + WatchOS RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) with offline map cache support. Track your location, add waypoi

Ed Cafferata 0 Jan 23, 2022
Super powerful remote config utility written in Swift (iOS, watchOS, tvOS, OSX)

Mission Control Super powerful remote config utility written in Swift (iOS, watchOS, tvOS, OSX) Brought to you by Have you ever wished you could chang

appculture 113 Sep 9, 2022
A Powerful , Extensible CSS Parser written in pure Swift.

A Powerful , Extensible CSS Parser written in pure Swift.

null 273 Sep 9, 2022
Alert popup to notify your users if they use an unsupported iOS version

UnsupportedOSVersionAlert This source code alerts your users if they use your app with an unsupported version of iOS (e.g. iOS 10.0 beta). The alert l

Josef Moser 8 Mar 11, 2019
TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app.

TypeStyle TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app. Featu

Eugene Belinski 31 Dec 14, 2022
A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.

ZamzamKit ZamzamKit is a Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and othe

Zamzam Inc. 261 Dec 15, 2022
A simple Swift utility for producing pseudolocalized strings.

Build your App UI to adapt and respond to translations, and find localization bugs!

Reece Como 2 Sep 28, 2021
A simple utility allowing to detect Swift version at runtime.

SwiftVersionDetector SwiftVersionDetector allows you to detect Swift version at runtime. Note that detecting the Swift version of the machine on which

Alessandro Venturini 2 Dec 3, 2022
A Swift app, named 'iPose', for iPhone's pose measurement based on Swift.

iPhone's pose measurement based on Swift. This is a Swift app, named 'iPose', for iPhone's pose measurement based on Swift. This is a side project to

Ghasem Abdi 3 Jul 26, 2022
BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

Blockchain Commons, LLC — A “not-for-profit” benefit corporation 4 Oct 6, 2022
macOS utility for converting fat-frameworks to SPM-compatible XCFramework with arm64-simulator support

xcframework-maker macOS utility for converting fat-frameworks to SPM-compatible XCFramework with arm64-simulator support. ?? Description make-xcframew

Dariusz Rybicki 312 Dec 22, 2022
A utility to generate PreviewDevice presets from the available devices

SwiftUIGen A utility to generate PreviewDevice presets from the available devices Installation Manual Go to the GitHub page for the latest release Dow

Timberlane Labs 29 Nov 14, 2022
Simple utility to change macOS Big Sur menu bar color by appending a solid color or gradient rectangle to a wallpaper image

Change menu bar color in macOS Big Sur Simple utility to change macOS Big Sur menu bar color by appending a solid color or gradient rectangle to a wal

Igor Kulman 876 Jan 5, 2023
Utility to run the SPI-Server tests as a benchmark

spi-benchmark This package comprises a simple tool to run the SwiftPackageIndex-Server tests in a loop, logging the run times. The purpose is to colle

Swift Package Index 2 Mar 13, 2022
A simple macOS utility that can be used to control the behaviour of Bose QC35 Headphones straight from the menu bar.

bose-macos-utility A simple macOS utility that can be used to control the behaviour of Bose QC35 Headphones straight from the menu bar. Why Have you e

Łukasz Zalewski 11 Aug 26, 2022
A tiny macOS utility to foster sustainable OSS

SustainableOSS SustainableOSS is a status bar app for macOS that indexes the third-party dependencies your projects depend on, sorts them by usage, an

Tuist 0 Dec 14, 2021
Simple utility for only executing code every so often.

Rate Limit Simple utility for only executing code every so often. This will only execute the block passed for a given name if the last time it was cal

Sam Soffes 921 Nov 20, 2022
Utility functions for validating IBOutlet and IBAction connections

Outlets Utility functions for validating IBOutlet and IBAction connections. About Outlets provides a set of functions which validate that IBOutlets ar

Ben Chatelain 129 May 2, 2022
It is a simple maths quiz app that will help users to test their math skills.

MathQuiz It is a simple maths quiz app that will help users to test their math skills. It has the following screens 1.Welcome screen with start button

null 0 Dec 27, 2021