All Projects → kirankunigiri → Apple-Signal

kirankunigiri / Apple-Signal

Licence: MIT license
Connect Apple devices via bluetooth and wifi.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Apple-Signal

Apple Family
A simple framework that brings Apple devices together - like a family
Stars: ✭ 59 (+118.52%)
Mutual labels:  wifi, bluetooth
Esp32marauder
A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32
Stars: ✭ 233 (+762.96%)
Mutual labels:  wifi, bluetooth
Find3 Android Scanner
An android app that scans Bluetooth and WiFi for FIND3
Stars: ✭ 99 (+266.67%)
Mutual labels:  wifi, bluetooth
Sparrow Wifi
Next-Gen GUI-based WiFi and Bluetooth Analyzer for Linux
Stars: ✭ 525 (+1844.44%)
Mutual labels:  wifi, bluetooth
rpi3-wifi-conf
A simple Python script to configure wifi over bluetooth for a Raspberry Pi 3
Stars: ✭ 112 (+314.81%)
Mutual labels:  wifi, bluetooth
Androbd
Android OBD diagnostics with any ELM327 adapter
Stars: ✭ 573 (+2022.22%)
Mutual labels:  wifi, bluetooth
Radareeye
A tool made for specially scanning nearby devices[BLE, Bluetooth & Wifi] and execute our given command on our system when the target device comes in-between range.
Stars: ✭ 218 (+707.41%)
Mutual labels:  wifi, bluetooth
Blynk Library
Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc.
Stars: ✭ 3,305 (+12140.74%)
Mutual labels:  wifi, bluetooth
ESP32 Thing Plus
ESP32 Thing-compatible board using the WROOM module and a QWIIC connector.
Stars: ✭ 18 (-33.33%)
Mutual labels:  wifi, bluetooth
ESP-WROOM-Breakout
Breakouts for ESP8266 and ESP32 WiFi/WLAN + Bluetooth modules from Espressif (ESP-WROOM-02, ESP-WROOM-32)
Stars: ✭ 32 (+18.52%)
Mutual labels:  wifi, bluetooth
Find3
High-precision indoor positioning framework, version 3.
Stars: ✭ 4,256 (+15662.96%)
Mutual labels:  wifi, bluetooth
Low power TTGO T-beam
Low power consumption for TTGO t-beam
Stars: ✭ 45 (+66.67%)
Mutual labels:  wifi, bluetooth
Mobly
E2E test framework for tests with complex environment requirements.
Stars: ✭ 424 (+1470.37%)
Mutual labels:  wifi, bluetooth
Potato Library
Easy to use Utility library for Android
Stars: ✭ 45 (+66.67%)
Mutual labels:  wifi, bluetooth
React Native System Setting
A library to access system setting, and change it easily. eg: volume, brightness, wifi
Stars: ✭ 319 (+1081.48%)
Mutual labels:  wifi, bluetooth
Multipeer
📱📲 A wrapper for the MultipeerConnectivity framework for automatic offline data transmission between devices
Stars: ✭ 170 (+529.63%)
Mutual labels:  wifi, bluetooth
Servus
Ad-hoc peer-to-peer iOS library
Stars: ✭ 27 (+0%)
Mutual labels:  wifi, bluetooth
Rtl8723bs
Realtek SDIO Wi-Fi driver
Stars: ✭ 260 (+862.96%)
Mutual labels:  wifi, bluetooth
Pedalino
Smart wireless MIDI foot controller for guitarists and more.
Stars: ✭ 105 (+288.89%)
Mutual labels:  wifi, bluetooth
ESP32 IMU BARO GPS VARIO
GPS altimeter/variometer with LCD display, routes with waypoints, data/gps track logging, bluetooth NMEA sentence transmission, wifi AP + webpage configuration
Stars: ✭ 72 (+166.67%)
Mutual labels:  wifi, bluetooth

Banner

Apple Signal Platform

License MIT Build Passing

A library that allows for local connections between Apple devices. It will automatically use either bluetooth or wifi to connect multiple devices and share information. Currently supports iOS and macOS.

Demo

iOS UI Demo

Upload

iOS Auto Connect Demo

Upload

Mac Demo

Upload

Installation

Grab the source folder and drag it into your project! If you are making a macOS app, you can remove the InviteTableViewController.swift and Signal.storyboard files. You also need to have peertalk by Rasmus installed.

Example

Signal is really easy to setup. Just start the connection, and you can begin sending and receiving data! This is a very basic overview. Check out the Complete Guide and Xcode demo project for the full capabilities.

Start the connection with a service type, which is just the name of your connection. In order to be discovered, a device must use the same service name. There are also multiple connection modes you can choose from.

Signal.instance.initialize(serviceType: "signal-demo")
Signal.instance.autoConnect()

In Signal, you can add a tag to the data you send so that the receiver knows what the data is. You can create a UInt32 enum to manage these tags. Here's an example:

enum DataType: UInt32 {
    case string = 100
    case image = 101
}

Send some text, and specify its type using our enum. Signal automatically converts objects to data using NSKeyedArchiver, so if you want to send your own data, use the sendData method instead.

Signal.instance.sendObject(object: "Hello World!", type: DataType.string.rawValue)

The protocol conformation. We get the data, check its type, convert it back to the according object (in this case, a string) using a handy data extension method, and update our UI. You can also update the list of connected devices with the second method.

func signal(didReceiveData data: Data, ofType type: UInt32) {
    if type == DataType.string.rawValue {
        let string = data.convert() as! String
    } else if type == DataType.image.rawValue {
        let image = UIImage(data: data)
    }
}

func signal(connectedDevicesChanged devices: [String]) {}

And we just setup a session where people can connect and send texts to each other. It's that simple!

Complete Guide

Signal uses the Multipeer Connectivity library by Apple, and simplifies the process. The process of making a session is overcomplicated, and their library of UI elements used to host/invite other devices is often slow or does not work at all. So, this library helps fix that with a much simpler session process along with custom UI elements.

Methods and Properties

This library has support on both iOS and macOS, but the UI elements have not yet been implemented on the macOS version. Thus, the inviteUI() and acceptUI are currently only available on the iOS version.

Setup

initialize(serviceType: String) - Specify a name for the signal. Limited to one hyphen (-) and 15 characters. Devices can only see each other if they have the same service name. This means that you can use a static string to allow all devices see each other, or you can also add in password functionality by making the user input a custom service name. If you ever want to change this, just run this method again.

initialize(serviceType: String, deviceName: String) - Specify a service type, but also use a custom name. If you don't use this method, the default device name will be used.

Connect

autoConnect() - The easiest and fastest way to connect. Automatically connects all devices also running this method (on the same service type) together.

inviteAuto() - Automatically invites all detected devices, and continues to look for more until stopped

inviteUI() -> UIViewController, iOS Only - This method returns a custom View Controller that you should present so that the user can see a list of available devices, and invite them by tapping on them. This view can be fully customized by editing the Signal.storyboard source file or the InviteTableViewController class in the source.

acceptAuto() - Automatically accepts any invites received until stopped

acceptUI(), iOS Only - In the protocol method, receivedInvitation, you will be given a UIAlertController that you can present. The user can then accept or decline the invitation.

Stop Services

stopInviting() and stopAccepting() - Stops the invitation or accept services

stopSearching() - Stops both inviting and accept services

disconnect() - Disconnects the user from the connected session

shutDown() - Shuts down all signal services. Stops searching and disconnects.

Data

sendData(object: Any) - Pass in any object to be sent to all other connected devices. It works by converting it to Data with the NSKeyedArchiver and then sending it. If you want to send multiple objects, the best way would be to use a single container class.

sendData(data: Data, type: UInt32) - Send data to all connected devices with a tag so that the receiver knows what type of data it is. An enum should be used to declare different types.

convert(), Data class extension - This is a method that can be used to convert data that you have received from another device back into a useful object. It will return type Any, but you can cast it into the right class.

connectionTimeout, default is 10 - The time (in seconds) a device can spend attempting to connect before quitting.

Protocol

You conform to the SignalDelegate protocol. There are 3 methods that provide you with useful information. These methods run in the background, so make sure that you use the main thread for any UI changes.

ignal(didReceiveData data: Data, ofType type: UInt32) - This runs whenever data has received. You can use the type to check and convert the data back into its corresponding object.

deviceConnectionsChanged(connectedDevices: [String]) - Runs whenever a device has connected/disconnected. It gives you the new list of connected device names.

Coming Soon

There are some more features that I'd like to add soon.

  • Quick auto connect
  • Simple data communication
  • iOS UI elements
  • macOS UI elements
  • Simple streaming

Contribute

Feel free to to contribute to the project with a pull request to add any new features or bug fixes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].