{"id":15717137,"url":"https://github.com/ukushu/iapprater","last_synced_at":"2025-07-10T00:04:10.611Z","repository":{"id":248022490,"uuid":"827536906","full_name":"ukushu/IAppRater","owner":"ukushu","description":"Tiny lib to show \"Rate my app\" alert for macOS and iOS apps.","archived":false,"fork":false,"pushed_at":"2025-02-27T12:14:53.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T15:49:08.247Z","etag":null,"topics":["appreview","appstore","ios","macos","macosx","rate-app","rate-app-api","rating","rating-stars","request","review","reviews","stars","storekit","storekit2","swift","swiftui"],"latest_commit_sha":null,"homepage":"","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/ukushu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2024-07-11T21:05:46.000Z","updated_at":"2025-02-27T12:14:57.000Z","dependencies_parsed_at":"2024-10-24T13:40:26.841Z","dependency_job_id":"441d0898-822b-4267-9c5c-7e2af2f0ed3c","html_url":"https://github.com/ukushu/IAppRater","commit_stats":null,"previous_names":["ukushu/iapprater"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ukushu/IAppRater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukushu%2FIAppRater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukushu%2FIAppRater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukushu%2FIAppRater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukushu%2FIAppRater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ukushu","download_url":"https://codeload.github.com/ukushu/IAppRater/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukushu%2FIAppRater/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264505746,"owners_count":23618966,"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":["appreview","appstore","ios","macos","macosx","rate-app","rate-app-api","rating","rating-stars","request","review","reviews","stars","storekit","storekit2","swift","swiftui"],"created_at":"2024-10-03T21:48:51.594Z","updated_at":"2025-07-10T00:04:10.594Z","avatar_url":"https://github.com/ukushu.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IAppRater \n\n\u003cimg src=\"https://github.com/ukushu/IAppRater/blob/main/IAppRaterLogo.png\" width=\"170\"\u003e\n\n\nTiny lib to show \"Rate my app\" alert for macOS and iOS apps.\n\n## SupportedOS:\niOS(?), MacOS(\u003e=12)\n\n## KeyFeatures:\n* Ability to set minimal amount of app launches before yout app perform request to rate your app\n*  --//-- minimum days of usage --//--\n* Do not ask to rate your app if this version already was rated by user\n* Ability to open standard \"Rate Me\" alert OR open \"Rate me\" popup inside of AppStore window\n* Ability to work with custom View logic like \"Show \"Rate my app\" button only if rate is needed\"\n* Ability to set additional custom rules for \"rate is needed\" state :)\n\n\n## How to use, sample with SwiftUI:\n\n//init custom AppDelegate\n```swift\nimport SwiftUI\n\n@main\nstruct FocusitoApp: App {\n    @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate\n    \n    var body: some Scene {\n        MainView()\n    }\n}\n```\n\n//init AppRater on `DidFinishLaunching` inside of AppDelegate\n```swift\nclass AppDelegate: NSObject, NSApplicationDelegate {\n    static var shared: AppDelegate!\n    \n    var appRater: IAppRater!\n    \n    func applicationDidFinishLaunching(_ notification: Notification) {\n        AppDelegate.shared = self\n        \n        // if we do not need custom display alert logic\n        //appRater = IAppRater(minLaunches: 10,\n        //                     minDays: 15,\n        //                     rateWndType: .standardAlert\n        //)\n        \n        // if we need custom display logic\n        appRater = IAppRater(minLaunches: 10,\n                             minDays: 15,\n                             other: { _ in Stats.shared.sessions.count \u003e 100 },\n                             rateWndType: .standardAlert\n        )\n        \n        // if we need to show request on app run:\n        // appRater.requestIfNeeded()\n        // and other code does not needed\n    }\n}\n```\n\n// We can locate button to open some panel\n```swift\nstruct MainView : View {\n    var body: some View {\n        VStack {\n            MyMainViewBody()\n            \n            if AppDelegate.shared.appRater.isNeededToRate() {\n                Button(\"Rate my app\") { model.showBottomPanel.toggle() }\n            } \n        }\n    }\n}\n```\n\n// We can locate button  to show \"Rate my app\" alert\n```swift\nstruct MainView : View {\n    var body: some View {\n        VStack {\n            MyMainViewBody()\n            \n            if AppDelegate.shared.appRater.isNeededToRate() {\n                Button(\"Rate my app\") { AppDelegate.shared.appRater.requestIfNeeded() }\n            } \n        }\n    }\n}\n```\n\n\n// We can open standard OS's alert\n\n\u003cimg src=\"https://i.sstatic.net/A2gyxsA8.png\" width=\"500\" height=\"200\"\u003e\n\n\u003cimg src=\"https://koenig-media.raywenderlich.com/uploads/2018/10/Simulator-Screen-Shot-iPhone-8-2018-10-27-at-16.39.08.png\" height=\"550\"\u003e\n\n// Or we can call appStore's alert \"Rate my app\" \n```swift\nappRater = IAppRater(...., rateWndType: .appStoreWnd(appId: \"1473808464\") )\n```\n\u003cimg src=\"https://i.sstatic.net/IYdbRLUW.png\" width=\"500\"\u003e\n\n## Extra custom logic for display panel witn \"Rate My App\" button:\n```swift\nappRater = IAppRater(minLaunches: 2,\n                     minDays: 2,\n                     other: { me in // 0\n                        (MainViewModel.shared.appState == .Idle || MainViewModel.shared.appState == .Paused) \u0026\u0026 // 1\n                            Stats.shared.sessions.map{ $0.duration }.sum() \u003e TimeInterval(hrs: 5) \u0026\u0026 // 2\n                            me.lastReviewDate == nil // 3\n                     },\n                     rateWndType: .appStoreWnd(appId: \"1473808464\")\n                    )\n```\n* - min app launches = 2\n* - min days after first app launch = 3\n* 0 - me = input of IAppRater's \"self\" for using some properties if needed for some custom purposes with them\n* 1 - if application state is .idle or .paused\n* 2 - if some sessions duration is larger than 5 hrs\n* 3 - if user have never did rate the app. But if he is rated at least once - never show \"rate app\" button to user\n\n### if you need to debug your \"isNeededToRate()\" value - you able to set input parameter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fukushu%2Fiapprater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fukushu%2Fiapprater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fukushu%2Fiapprater/lists"}