Swiftpack.co - Package - SOBotics/SwiftRedunda

SwiftRedunda

Build Status

SwiftRedunda is a library to ping Redunda.

Installation:

Using the Swift Package Manager:

In the dependencies section of your Package.swift, add the following package:

.package(url: "https://github.com/SOBotics/SwiftRedunda.git", from: "0.1.0")

Add "SwiftRedunda" to the dependencies array in the .target of targets.

Installation complete!

Usage

On top of your swift file, import the module:

import SwiftRedunda

Then use RedundaPingService to ping the server.

let pingService = RedundaPingService(key: "YOUR_KEY_HERE", version: "1.0") // remember to generate a key at redunda.sobotics.org first!
pingService.startPinging()

Before posting chat messages, remember to see if you should be in standby mode first!

if !pingService.shouldStandby {
    // post messages
}

You should also use a class which conforms to the protocol RedundaPingServiceDelegate to receive errors. Set the delegate of you RedundaPingService using the following:

pingService.delegate = PingServiceDelegate

where PingServiceDelegate conforms to RedundaPingServiceDelegate.

You can set the service to debug mode with pingService.debug = true. If this value is true, Redunda won't be pinged.

Report bugs

Report bugs in the issues section of this repository.

Contact me

You can contact me by pinging me with @paper in chat in the SOBotics chat room.

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

0.1.6 - Jul 15, 2018

Fixed a bug about version not sent to Redunda.

0.1.5 - Jul 14, 2018

Bug fix on debug mode.

0.1.4 - Apr 10, 2018

This fixes a bug related to RedundaPingServiceDelegate delegating statusChange events even when the status didn't change.

0.1.3 - Jan 27, 2018

More bug fixes

0.1.2 - Jan 27, 2018

Bug fix