Popularity
3.2
Growing
Activity
0.0
Stable
136
16
5

Code Quality Rank: L4
Monthly Downloads: 3
Programming language: Swift
License: MIT License
Tags: Network    
Latest version: v0.1.0

Stargate alternatives and similar libraries

Based on the "Network" category

Do you think we are missing an alternative of Stargate or a related project?

Add another 'Network' Library

README

Stargate

Version License Platform Build Status <!-- Coverage Status -->

[](Stargate.gif)

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](Example/) 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](LICENSE) for further details.


*Note that all licence references and agreements mentioned in the Stargate README section above are relevant to that project's source code only.