GithubHelp home page GithubHelp logo

gungun974 / bbportal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dagostini/bbportal

0.0 1.0 0.0 1.67 MB

A library that will enable you to pass data between your extensions and applications.

License: MIT License

Ruby 1.37% Swift 3.53% C 46.96% Makefile 47.04% Objective-C 1.09%

bbportal's Introduction

BBPortal

Version License Platform

Description

BBPortal is a library that will enable you to pass data between your targets and applications (excluding the watch target). It's using App Groups in the background to save data in the shared container and another library - DAFileMonitor - is used to listen to changes on the file. You can create as many portals as you want. You can give your portals different IDs or you can give them all the same ID. When you push data through your portal, all other portals with the same ID will receive the data.

In the example below, you can see two apps controlling each other by passing data in real-time:

BBPortal_usage_med2

You can read more about this library on my blog: http://agostini.tech/2017/08/13/sharing-data-between-applications-and-extensions-using-app-groups/

Usage

var portal: BBPortalProtocol = BBPortal(withGroupIdentifier: "your.group.identifier.goes.here", andPortalID: "id.for.this.portal")

// Send data
portal.send(data: ["key": "What ever data you want"]) { 
    (error) in

    if let anError = error {
        print("Send failed with error: ", anError)
    }
}

// Receive data
portal.onDataAvailable = {
    (data) in

    guard let dict = data as? [String: Any?] else {
        return
    }

    print("I received some data through the portal: ", dict)
}

Installation

BBPortal is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'BBPortal'

Author

Dejan Agostini, [email protected] Update by gungun974, [email protected]

License

BBPortal is available under the MIT license. See the LICENSE file for more info.

bbportal's People

Contributors

dagostini avatar gungun974 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.