Latest 0.1.2
Homepage https://github.com/dagostini/BBPortal
License MIT
Platforms ios 8.0
Dependencies DAFileMonitor
Authors

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]

License

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

Latest podspec

{
    "name": "BBPortal",
    "version": "0.1.2",
    "summary": "A library that will enable you to pass data between your extensions and applications.",
    "description": "This library is using App Groups as a mechanism to pass data between your extensions and the main app target. You can also pass data between your applications. It doesn't work with watch targets, but it can easily be extended to do so. The main goal of this library is to make passing of data between targets as simple as possible. You give IDs to your portals and when you push data through the portal the data will come out of the other portals with the same ID.",
    "homepage": "https://github.com/dagostini/BBPortal",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dejan Agostini": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dagostini/BBPortal.git",
        "tag": "0.1.2"
    },
    "social_media_url": "https://twitter.com/dagostin",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "BBPortal/Classes/**/*",
    "dependencies": {
        "DAFileMonitor": []
    }
}

Pin It on Pinterest

Share This