{"id":32143159,"url":"https://github.com/groupeminaste/donateviewcontroller","last_synced_at":"2026-03-05T08:02:34.857Z","repository":{"id":63911614,"uuid":"272646605","full_name":"groupeminaste/DonateViewController","owner":"groupeminaste","description":"A view controller to make donations.","archived":false,"fork":false,"pushed_at":"2022-07-22T10:43:42.000Z","size":53,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-21T07:53:20.412Z","etag":null,"topics":["donate","donation-management","ios","spm","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/groupeminaste.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["GroupeMINASTE","NathanFallet"]}},"created_at":"2020-06-16T08:01:15.000Z","updated_at":"2023-02-13T17:38:56.000Z","dependencies_parsed_at":"2023-01-14T13:16:03.709Z","dependency_job_id":null,"html_url":"https://github.com/groupeminaste/DonateViewController","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/groupeminaste/DonateViewController","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupeminaste%2FDonateViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupeminaste%2FDonateViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupeminaste%2FDonateViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupeminaste%2FDonateViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groupeminaste","download_url":"https://codeload.github.com/groupeminaste/DonateViewController/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupeminaste%2FDonateViewController/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280225806,"owners_count":26293888,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["donate","donation-management","ios","spm","swift"],"created_at":"2025-10-21T07:53:27.572Z","updated_at":"2025-10-21T07:53:28.821Z","avatar_url":"https://github.com/groupeminaste.png","language":"Swift","funding_links":["https://github.com/sponsors/GroupeMINASTE","https://github.com/sponsors/NathanFallet","https://paypal.me/NathanFallet"],"categories":[],"sub_categories":[],"readme":"# DonateViewController\n\n[![License](https://img.shields.io/github/license/GroupeMINASTE/DonateViewController)](LICENSE)\n[![Issues](https://img.shields.io/github/issues/GroupeMINASTE/DonateViewController)]()\n[![Pull Requests](https://img.shields.io/github/issues-pr/GroupeMINASTE/DonateViewController)]()\n[![Code Size](https://img.shields.io/github/languages/code-size/GroupeMINASTE/DonateViewController)]()\n[![CodeFactor](https://www.codefactor.io/repository/github/groupeminaste/donateviewcontroller/badge)](https://www.codefactor.io/repository/github/groupeminaste/donateviewcontroller)\n[![Open Source Helpers](https://www.codetriage.com/groupeminaste/donateviewcontroller/badges/users.svg)](https://www.codetriage.com/groupeminaste/donateviewcontroller)\n\nA view controller to make donations.\n\n## Installation\n\nAdd `https://github.com/GroupeMINASTE/DonateViewController.git` to your Swift Package configuration (or using the Xcode menu: `File` \u003e `Swift Packages` \u003e `Add Package Dependency`)\n\n## Usage\n\n\u003e ⚠️ You need to register your in app purchases in App Store Connect to make it work. The name and the price of purchases will be used.\n\nFirst, import the package in your view controller where you want to open the `DonateViewController`.\n\n```swift\n// Import the package\nimport DonateViewController\n```\n\nCreate a method to open it:\n\n```swift\n// Import the package\nimport DonateViewController\n\nclass MyViewController: UIViewController {\n\n    // Some code...\n\n    func openDonateViewController() {\n        // Create the view controller\n        let controller = DonateViewController()\n        \n        // Customize view title, header and footer (optional)\n        controller.title = \"Donate\"\n        controller.header = \"Select an amount to donate:\"\n        controller.footer = \"The donations help us to improve our projects (...)\"\n        \n        // Add a delegate to get notified when a donation ends\n        controller.delegate = self\n        \n        // Add donations\n        controller.add(identifier: \"my.app.identifier.mydonation1\")\n        controller.add(identifier: \"my.app.identifier.mydonation2\")\n        // ... (add as many donations as you want)\n        \n        // And open your view controller: (two ways)\n        \n        // 1. In your navigation controller\n        navigationController?.pushViewController(controller, animated: true)\n        \n        // 2. In a modal\n        present(UINavigationController(rootViewController: controller), animated: true, completion: nil)\n    }\n\n    // Some code...\n\n}\n```\n\nThen you need to implement the `DonateViewControllerDelegate` protocol to get notified when a donation ends:\n\n```swift\n// Import the package\nimport DonateViewController\n\nclass MyViewController: UIViewController, DonateViewControllerDelegate { // Add the protocol to the view controller\n\n    // Some code...\n    \n    // The method we just created (no changes)\n    func openDonateViewController() {\n        // ...\n    }\n    \n    // Implement delegate methods\n    \n    func donateViewController(_ controller: DonateViewController, didDonationSucceed donation: Donation) {\n        // Handle when the donation succeed\n        \n    }\n    \n    func donateViewController(_ controller: DonateViewController, didDonationFailed donation: Donation) {\n        // Handle when the donation failed\n        \n    }\n    \n    // Some code...\n\n}\n```\n\nYou can show a `UIAlertController` with a little message for exemple.\n\nAnd call the `openDonateViewController()` method when you want to open the `DonateViewController`:\n\n```swift\nself.openDonateViewController()\n```\n\nThis can be called when the user clicks on a `UIButton` (in the selector method) or when the user selects a table view cell.\n\nThat's all, you're ready to receive donations!\n\n## Customize colors for theming (iOS \u003c 13)\n\nBefore iOS 13, no dark theme was implemented in controllers. If you want to implement your custom dark theme, subclass `DonateViewController` and `DonateCell` to change the colors of the views. (background, ...)\n\n## Donate to the developer\n\nFeel free to make a donation to help the developer to make more great content! [Donate now](https://paypal.me/NathanFallet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroupeminaste%2Fdonateviewcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroupeminaste%2Fdonateviewcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroupeminaste%2Fdonateviewcontroller/lists"}