{"id":18622767,"url":"https://github.com/timonus/tjbackgroundtask","last_synced_at":"2026-07-06T19:31:16.950Z","repository":{"id":141729660,"uuid":"343550534","full_name":"timonus/TJBackgroundTask","owner":"timonus","description":"Convenient wrapper around UIApplication background tasks","archived":false,"fork":false,"pushed_at":"2024-03-14T03:31:28.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-30T08:29:49.126Z","etag":null,"topics":["background-refresh","objective-c","uiapplication","uikit"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timonus.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,"zenodo":null}},"created_at":"2021-03-01T20:39:44.000Z","updated_at":"2025-09-25T13:53:39.000Z","dependencies_parsed_at":"2024-03-14T04:30:56.749Z","dependency_job_id":"769ac1a2-117c-47a4-9571-2e9800359569","html_url":"https://github.com/timonus/TJBackgroundTask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timonus/TJBackgroundTask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJBackgroundTask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJBackgroundTask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJBackgroundTask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJBackgroundTask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timonus","download_url":"https://codeload.github.com/timonus/TJBackgroundTask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timonus%2FTJBackgroundTask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35204409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"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":["background-refresh","objective-c","uiapplication","uikit"],"created_at":"2024-11-07T04:18:33.514Z","updated_at":"2026-07-06T19:31:16.396Z","avatar_url":"https://github.com/timonus.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TJBackgroundTask\n\nThis project is a wrapper around [`UIApplication`'s background task APIs](https://developer.apple.com/documentation/uikit/uiapplication/1623051-beginbackgroundtaskwithname?language=objc) that reduces boiler plate and helps avoid common pitfalls.\n\n## What does this do for me?\n\nThis project class does the following handy things\n- It automatically ends background tasks that are about to expire.\n- It uses object lifecycles instead of background task IDs for managing tasks, which makes it harder to \"leak\" or mismanage tasks. Tasks are automatically ended when `TJBackgroundTask`s are deallocated.\n- It avoids starting background tasks if \u003c 5 seconds of background time remains, which is recommended in [this WWDC talk](https://developer.apple.com/videos/play/wwdc2020/10078/?t=640).\n\n## Usage\n\n```objc\nTJBackgroundTask *const task = [[TJBackgroundTask alloc] initWithName:@\"my async work\"];\ndispatch_async(..., ^{\n    // Do some work\n    // ...\n    [task endTask];\n});\n\n// or, more simply\n\nTJBackgroundTask *const task = [[TJBackgroundTask alloc] initWithName:@\"my sync work\"];\n// Do some work\n// ...\n[task endTask];\n```\n\nSome notes:\n- You can call `-endTask` any number of times, it'll do the right thing if you call it more than once.\n- `TJBackgroundTask`'s initializers will return `nil` if the app is in a state it deems isn't eligible for background tasks.\n- `TJBackgroundTask` can be used from any thread if you're into that sort of thing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonus%2Ftjbackgroundtask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimonus%2Ftjbackgroundtask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonus%2Ftjbackgroundtask/lists"}