A communication channel from your Mac to your watch.

Related tags

Networking Stargate
Overview

Stargate

Version License Platform Build Status

A communication channel from your Mac to your watch.

Providing a convenient wrapper around MMWormhole and PeerKit, Stargate leverages Multipeer Connectivity and App Groups to communicate between an OS X application and ᴡᴀᴛᴄʜ via your iPhone. The communication is bi-directional and lets you send any object that complies with NSCoding.

Usage

Simply install it via CocoaPods:

use_frameworks!

pod 'Stargate'

Note: make sure you use version 0.37 or newer. Stargate is written in Swift 1.2, so it requires Xcode 6.3 or newer as well.

On the Mac

Send and receive messages via Multipeer Connectivity:

let stargate = Earth(applicationGroupIdentifier: "group.com.contentful.Stargate")

stargate.listenForMessage(identifier: "stargate2") { (object) -> Void in
	println("Received message on Mac: \(object)")
}

stargate.passMessage("YOLO", identifier: "stargate")

On the phone

Bridge messages between Multipeer and Darwin notifications:

let stargate = Abydos(applicationGroupIdentifier: "group.com.contentful.Stargate")
    
stargate.tunnel()
stargate.tunnelReplies(identifier: "stargate2")

On the watch

Send and receive messages via Darwin notifications:

let stargate = Atlantis(applicationGroupIdentifier: "group.com.contentful.Stargate")

stargate.passMessage("YOLO", identifier:"stargate2")

stargate.listenForMessage(identifier:"stargate") { (object) -> Void in
	println("Received message on watch: \(object)")
}

stargate.stopListeningForMessage(identifier:"stargate")

Look at the example project for guidance on how to set up one project for all three platforms. When creating the targets, make sure you don't accidentially select the OS X target as host for the WatchKit extension.

License

Copyright (c) 2015 Contentful GmbH. See LICENSE for further details.

You might also like...
StatusBarOverlay will automatically show a
StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again. It supports apps which hide the status bar and The Notch

StatusBarOverlay StatusBarOverlay will automatically show a "No Internet Connection" bar when your app loses connection, and hide it again. It support

Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application.
Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application.

Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application. Install Carthage

Powering your RAC architecture
Powering your RAC architecture

Intro Most applications out there follow the same pattern: Is T persisted and has not expired? Yes: Use it ✅ No: Fetch T from the network 1. Do we hav

Get your device ip address, router ip or wifi ssid
Get your device ip address, router ip or wifi ssid

FGRoute FGRoute is written on C and Objective C (includes Swift support), it helps developers to get rid of dealing with WiFi interfaces. Example To r

Setup your class structure in Xcode Interface Builder and save() in Parse Server.
Setup your class structure in Xcode Interface Builder and save() in Parse Server.

ISParseBind With ISParseBind you can save, update and query PFObjects using the power of Xcode Interface Builder resources. https://www.youtube.com/wa

iOS client for the Brewfactory project - brew your own beer
iOS client for the Brewfactory project - brew your own beer

BrewMobile iOS client for the Brewfactory project. Read the stories of upgrading BrewMobile to ReactiveCocoa & Swift on AllTheFlow. What is this? App

The fastest iOS app to add a note to your email inbox
The fastest iOS app to add a note to your email inbox

Major Key How often are you on the run, or hanging out with friends, only to suddenly think of this really important thing you need to do when you're

An iOS app for communicating with your clightning node over the lightning network

An iOS app for communicating with your clightning node over the lightning network

A super fast & convenient object mapper tailored for your needs
A super fast & convenient object mapper tailored for your needs

A super fast & convenient object mapper tailored for your needs. Mapping objects to arrays or dictionaries can be a really cumbersome task, but those

Releases(0.1.0)
Owner
Contentful
Contentful
OBSwiftSocket is a Swift library to be used for communication with OBS Studio via obs-websocket (v5).

OBSwiftSocket OBSwiftSocket is a Swift library to be used for communication with OBS Studio via obs-websocket (v5). obs-websocket v5 specification: ht

Edon 3 Sep 28, 2022
Apple watch app to interface with Transmission Client

TransmissionWatch Apple watch app to interface with Transmission Client Currrent

Aayush 2 Dec 23, 2021
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app.

This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and Apple TV app. With this Framework you can create iPh

Prioregroup.com 479 Nov 22, 2022
A remote for your IR devices for iOS and Mac!

Command your TV, Apple TV or Receiver with your Mac/iOS device through iTach. Screenshots On iOS: On Mac (notification center): How to use Buy a iTach

Michael Villar 19 Nov 4, 2022
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)

SwiftSoup is a pure Swift library, cross-platform (macOS, iOS, tvOS, watchOS and Linux!), for working with real-world HTML. It provides a very conveni

Nabil Chatbi 3.7k Dec 28, 2022
Asynchronous socket networking library for Mac and iOS

CocoaAsyncSocket CocoaAsyncSocket provides easy-to-use and powerful asynchronous socket libraries for macOS, iOS, and tvOS. The classes are described

Robbie Hanson 12.3k Jan 8, 2023
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone

ASIHTTPRequest is an easy to use wrapper around the CFNetwork API that makes some of the more tedious aspects of communicating with web servers easier

Ben Copsey 5.8k Dec 14, 2022
iOS/Mac OS framework for Rails

NSRails is a lightweight framework that makes mapping client-side objects to remote Rails objects a breeze, and calling CRUD operations and others sup

Dan Hassin 523 Nov 19, 2022
Lightweight Networking and Parsing framework made for iOS, Mac, WatchOS and tvOS.

NetworkKit A lightweight iOS, Mac and Watch OS framework that makes networking and parsing super simple. Uses the open-sourced JSONHelper with functio

Alex Telek 30 Nov 19, 2022
Conforming WebSocket (RFC 6455) client library for iOS and Mac OSX

SwiftWebSocket Conforming WebSocket (RFC 6455) client library for iOS and Mac OS

null 0 Dec 24, 2021