{"id":13467300,"url":"https://github.com/takecian/SwiftRater","last_synced_at":"2025-03-26T01:30:46.283Z","repository":{"id":19251682,"uuid":"86415646","full_name":"takecian/SwiftRater","owner":"takecian","description":"A utility that reminds your iPhone app's users to review the app written in pure Swift.","archived":false,"fork":false,"pushed_at":"2024-09-19T07:51:20.000Z","size":651,"stargazers_count":355,"open_issues_count":8,"forks_count":42,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-01T01:58:17.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takecian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-28T04:42:10.000Z","updated_at":"2024-09-19T07:51:24.000Z","dependencies_parsed_at":"2024-04-09T01:28:33.493Z","dependency_job_id":"860db141-b4b5-4dad-8cbc-15012e0e7fab","html_url":"https://github.com/takecian/SwiftRater","commit_stats":{"total_commits":108,"total_committers":17,"mean_commits":6.352941176470588,"dds":0.6759259259259259,"last_synced_commit":"6e07727161adf945e3d80425b2a977026fd5b9bd"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takecian%2FSwiftRater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takecian%2FSwiftRater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takecian%2FSwiftRater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takecian%2FSwiftRater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takecian","download_url":"https://codeload.github.com/takecian/SwiftRater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222100834,"owners_count":16931670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:00:54.886Z","updated_at":"2025-03-26T01:30:46.276Z","avatar_url":"https://github.com/takecian.png","language":"Swift","funding_links":[],"categories":["Libs","Utility [🔝](#readme)","Utilities and Extensions"],"sub_categories":["Utility"],"readme":"# SwiftRater\n\n[![Version](https://img.shields.io/cocoapods/v/SwiftRater.svg?style=flat)](http://cocoapods.org/pods/SwiftRater)\n[![License](https://img.shields.io/cocoapods/l/SwiftRater.svg?style=flat)](http://cocoapods.org/pods/SwiftRater)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftakecian%2FSwiftRater%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/takecian/SwiftRater)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftakecian%2FSwiftRater%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/takecian/SwiftRater)\n[![Build Status](https://app.bitrise.io/app/55becad13fb442f0/status.svg?token=xvASA1R9AsaeRnPDE7ZLUQ\u0026branch=master)](https://app.bitrise.io/app/55becad13fb442f0)\n[![codebeat badge](https://codebeat.co/badges/a7a60a68-81df-4015-bf04-52a8fb621952)](https://codebeat.co/projects/github-com-takecian-swiftrater-master)\n\nSwiftRater 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.\n\nSwiftRater is written in pure Swift.\n\n## iOS\n![SwiftRater1](./Resource/later1.gif)\n\n## macOS\n![SwiftRater1](./Resource/macos-later1.gif)\n\n## Requirements\n\niOS 13.0, macOS 10.15 or later, written in Swift.\n\n## Installation\n\n### SPM\n\nOpen your project setting and navigate to \"Package dependencies\" tab. Put \"https://github.com/takecian/SwiftRater\".\n\n### Cocoapods\n\nSwiftRater is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"SwiftRater\"\n```\n### Carthage\n\nSwiftRater is compatible with [Carthage](https://github.com/Carthage/Carthage). Add it to your `Cartfile`:\n\n```ruby\ngithub \"takecian/SwiftRater\"\n```\n\n## Usage\n\n1.Setup SwiftRater in AppDelegate.swift. After setting up, call `SwiftRater.appLaunched()`.\n\n```\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n        SwiftRater.daysUntilPrompt = 7\n        SwiftRater.usesUntilPrompt = 10\n        SwiftRater.significantUsesUntilPrompt = 3\n        SwiftRater.daysBeforeReminding = 1\n        SwiftRater.showLaterButton = true\n        SwiftRater.debugMode = true\n        SwiftRater.appLaunched()\n\n        return true\n    }\n\n```\n\nIf you are using SwiftUI, create AppDelegate class that inherits UIApplicationDelegate and\nconfigure SwiftRater there. (Thanks [@markgravity](https://github.com/markgravity) for the suggetion)\n\n```\n@main\nstruct YourApp: App {\n    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n        }\n    }\n}\n\nclass AppDelegate: NSObject, UIApplicationDelegate {\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -\u003e Bool {\n        SwiftRater.daysUntilPrompt = 7\n        SwiftRater.usesUntilPrompt = 10\n        SwiftRater.significantUsesUntilPrompt = 3\n        SwiftRater.daysBeforeReminding = 1\n        SwiftRater.showLaterButton = true\n        SwiftRater.debugMode = true\n        SwiftRater.appLaunched()\n        return true\n    }\n}\n```\n\n| Property      | Description           |\n| :------------- |:-------------|\n| daysUntilPrompt      | Shows review request if `daysUntilPrompt` days passed since first app launch. |\n| usesUntilPrompt      | Shows review request if users launch more than `usesUntilPrompt` times.      |\n| significantUsesUntilPrompt | Shows review request if user does significant actions more than `significantUsesUntilPrompt` |\n\nYou can set properties you want to apply.\n\n| Property      | Description           |\n| :------------- |:-------------|\n| debugMode      | Shows review request every time. Default false, **need to set false when you submit app to AppStore**. |\n| conditionsMetMode | Possible values: `.any`, `.all` (default)\u003cbr /\u003e Setting this to `.any` allows the prompt to be shown **when any one or more of your criteria have been met**.  |\n| showLaterButton | Show Later button in review request dialog, valid for iOS10.2 or before devices.|\n| daysBeforeReminding | Days until reminder popup if the user chooses `rate later`,  valid for iOS10.2 or before devices.      |\n\n2.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.\n\n```\n    override func viewDidAppear(_ animated: Bool) {\n        super.viewDidAppear(animated)\n        SwiftRater.check()\n    }\n\n```\n\n3(Optional).For `significantUsesUntilPrompt`, you need to add `SwiftRater.incrementSignificantUsageCount` in siginificant action for your app.\n\n```\nfunc postComment() {\n    // do something ..\n\n\tSwiftRater.incrementSignificantUsageCount()\n}\n\n```\n\n4(Optional).Call `SwiftRater.rateApp(host:)` to let your users to review your app on the App Store/in your app directly.\n\n```\nfunc rateButtonDidClick(sender: UIButton) {\n    // do something ..\n\n\tSwiftRater.rateApp(host: self)\n}\n\n```\n\n## Example\n\nThis 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.\n\n```\nSwiftRater.daysUntilPrompt = 7\nSwiftRater.usesUntilPrompt = 5\nSwiftRater.daysBeforeReminding = 5\nSwiftRater.appLaunched()\n```\n\nIf you wanted to show the request after 5 days only and remind 7 days after if later selected, you can set the following:\n\n```\nSwiftRater.daysUntilPrompt = 5\nSwiftRater.daysBeforeReminding = 7\nSwiftRater.appLaunched()\n```\n\nIf you wanted to show the request after a user performs 10 significant actions before 5 days or 5 uses have passed:\n\n```\nSwiftRater.conditionsMetMode = .any\nSwiftRater.daysUntilPrompt = 5\nSwiftRater.usesUntilPrompt = 5\nSwiftRater.significantUsesUntilPrompt = 10\n```\n\n## Customize text\n\nYou can customize text in review request dialog for iOS10.2 or before devices. Set text in following properties.\n- SwiftRater.alertTitle\n- SwiftRater.alertMessage\n- SwiftRater.alertCancelTitle\n- SwiftRater.alertRateTitle\n- SwiftRater.alertRateLaterTitle\n- SwiftRater.appName\n\n## Country code\n\nIf your app is only avaiable for some coutnries, please add country code at Setup phase.\n\n```\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n        SwiftRater.daysUntilPrompt = 7\n        SwiftRater.usesUntilPrompt = 10\n\n        SwiftRater.countryCode = \"fr\"\n\n        SwiftRater.debugMode = true\n        SwiftRater.appLaunched()\n        return true\n    }\n```\n\n## App ID\n\nOptional, you can set App ID explicitly. If not, SwiftRater will get App ID from appstore by bundle ID.\n\n```\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n        SwiftRater.daysUntilPrompt = 7\n        SwiftRater.usesUntilPrompt = 10\n\n        SwiftRater.appID = \"1104775712\"\n\n        SwiftRater.debugMode = true\n        SwiftRater.appLaunched()\n        return true\n    }\n```\n## Demo\n\nYou can find Demo app in this repo.\n\n## Author\n\ntakecian, takecian@gmail.com\n\n## License\n\nSwiftRater is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakecian%2FSwiftRater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakecian%2FSwiftRater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakecian%2FSwiftRater/lists"}