2 "name": "Communicator",
4 "summary": "Communication between iOS and watchOS apps just got a whole lot better.",
5 "description": "Sending messages and data between watchOS and iOS apps\nis possible thanks to Apple's work on `WatchConnectivity`,\nbut there are a lot of delegate callbacks to work with,\nsome of the API calls are similar, and it's not really\nclear which is needed for what purpose.\n\n`Communicator` means you don't have to spend any time writing a cross-platform wrapper around `WatchConnectivity` and is extremely easy to use.\n\nEach app gets its own shared `Communicator` object to use which handles all the underlying session stuff:\n\n```swift\nCommunicator.shared\n```\n\nUsage between the two platforms is identical, so you can\nuse it in a shared framework with few workarounds.\n\nHere's how you send a simple message with Communicator.\n\n```swift\nlet message = ImmediateMessage(identifier: \"1234\", content: [\"messageKey\" : \"This is some message content!\"])\ntry? Communicator.shared.send(immediateMessage: message)\n```\n\nThis will try to send a message to the counterpart immediately. If the underlying session is not active, the `try` will fail and Communicator will `throw` an error you can catch if you want.\n\nOn the other device you register as an observer for new messages:\n\n```swift\nCommunicator.shared.immediateMessageReceivedObservers.add { message in\n if message.identifier == \"1234\" {\n print(\"Message received: (message.content)\")\n }\n}\n```\n\nThe great thing about using this style of observing means that you can observe these messages from anywhere in your app and filter out the ones you don't care about.\n\n`Communicator` can also transfer `Blob`s and sync `Context`s.\n\n`Blob`s are perfect for sending larger amounts of data (`WatchConnectivity` will reject large data in other types of messages), and will continue to transfer even if your app\nis terminated during transfer.\n\nYou can use a `Context` to keep things in sync between devices, which makes it perfect for preferences. `Context`s are not suitable for messaging or sending large data.",
6 "homepage": "https://github.com/KaneCheshire/Communicator",
12 "Kane Cheshire": "@kanecheshire"
15 "git": "https://github.com/KaneCheshire/Communicator.git",
18 "social_media_url": "https://twitter.com/kanecheshire",
23 "source_files": "Sources/**/*",
24 "frameworks": "WatchConnectivity",
25 "swift_versions": "5.0",
26 "swift_version": "5.0"