{"id":17090897,"url":"https://github.com/phimage/applicationgroupkit","last_synced_at":"2025-08-17T13:13:12.450Z","repository":{"id":56902297,"uuid":"49029299","full_name":"phimage/ApplicationGroupKit","owner":"phimage","description":"Share informations betweens your applications and your extensions using group identifier","archived":false,"fork":false,"pushed_at":"2020-01-29T07:06:14.000Z","size":78,"stargazers_count":39,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-06T11:07:24.066Z","etag":null,"topics":[],"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/phimage.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}},"created_at":"2016-01-04T23:20:56.000Z","updated_at":"2024-12-26T08:00:16.000Z","dependencies_parsed_at":"2022-08-20T18:50:53.585Z","dependency_job_id":null,"html_url":"https://github.com/phimage/ApplicationGroupKit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/phimage/ApplicationGroupKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FApplicationGroupKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FApplicationGroupKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FApplicationGroupKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FApplicationGroupKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phimage","download_url":"https://codeload.github.com/phimage/ApplicationGroupKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FApplicationGroupKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260419595,"owners_count":23006312,"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-10-14T13:57:03.304Z","updated_at":"2025-06-17T18:36:17.767Z","avatar_url":"https://github.com/phimage.png","language":"Swift","readme":"# ApplicationGroupKit\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n            )](http://mit-license.org)\n[![Platform](http://img.shields.io/badge/platform-ios_osx_tvos-lightgrey.svg?style=flat\n             )](https://developer.apple.com/resources/)\n[![Language](http://img.shields.io/badge/language-swift-orange.svg?style=flat\n             )](https://developer.apple.com/swift)\n[![Issues](https://img.shields.io/github/issues/phimage/ApplicationGroupKit.svg?style=flat\n           )](https://github.com/phimage/ApplicationGroupKit/issues)\n[![Cocoapod](http://img.shields.io/cocoapods/v/ApplicationGroupKit.svg?style=flat)](http://cocoadocs.org/docsets/ApplicationGroupKit/)\n[![Join the chat at https://gitter.im/phimage/ApplicationGroupKit](https://img.shields.io/badge/GITTER-join%20chat-00D06F.svg)](https://gitter.im/phimage/ApplicationGroupKit?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[\u003cimg align=\"left\" src=\"logo.png\" hspace=\"20\"\u003e](#logo) Applications communication using group identifier.\n```swift\nlet appGroup = ApplicationGroup(identifier: \"group.id\")\nappGroup.postMessage(\"your message\", withIdentifier: \"key\")\n```\n```swift\nappGroup.observeMessageForIdentifier(\"key\") { message in\n ...\n}\n```\n\n## Usage\n\nThe data sharing between applications and extensions require you to enable App Group or Keychain sharing (if using key chain messenger type):\n- [Configuring App Groups](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW61)\n- [Configuring Keychain Sharing](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW15)\n\nThen you must create an `ApplicationGroup` object.\n```swift\nlet appGroup = ApplicationGroup(identifier: \"your.application.group.id\")!\n```\nYou can choose the way the messages are transferred by choosing one of the `MessengerType` enum value (`File`, `UserDefaults`, `FileCoordinator`, `KeyChain`, ...)\n```swift\nlet appGroup = ApplicationGroup(identifier: \"..\", messengerType: .UserDefaults)!\n```\n:warning: `ApplicationGroup` could return `nil` if you misconfigured application group.\n\n### Post a message\n\nChoose a message identifier and post any `NSCoding` compliant object\n```swift\nappGroup.postMessage(\"your message\", withIdentifier: \"key to identify message\")\n```\n\n#### Using subscript\n```swift\nappGroup[\"key to identify message\"] = \"your message\"\n```\n\n### Receive a message\nUsing the same message identifier you can receive message into callback\n```swift\nappGroup.observeMessageForIdentifier(\"key to identify message\") { message in\n ..\n}\n```\n### Read a message\nYou can read current value using same message identifier\n```swift\nif let message = appGroup.messageForIdentifier(\"key to identify message\") {\n  ..\n}\n```\n#### Using subscript\n```swift\nif let message = appGroup[\"key to identify message\"] as? String { .. }\n```\n## Todo\n- Tests\n- WatchKit (WatchConnectivity/WCSession...)\n- Carthage: let me know if carthage work and I will add the shell.io badges and installation instruction\n\n## Contribute\nI am more than happy to accept external contributions to the project in the form of feedback, bug reports and even better pull requests.\n\nImplement WatchKit features and I will add you to the project (I have no need and time to do it now)\n\n## Installation\n\n## Using CocoaPods ##\n[CocoaPods](https://cocoapods.org/) is a centralized dependency manager for\nObjective-C and Swift. Go [here](https://guides.cocoapods.org/using/index.html)\nto learn more.\n\n1. Add the project to your [Podfile](https://guides.cocoapods.org/using/the-podfile.html).\n\n    ```ruby\n    use_frameworks!\n\n    pod 'ApplicationGroupKit'\n    ```\n\n2. Run `pod install` and open the `.xcworkspace` file to launch Xcode.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphimage%2Fapplicationgroupkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphimage%2Fapplicationgroupkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphimage%2Fapplicationgroupkit/lists"}