Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KumulosCheckinClient to interact with contact tracing checkins API #65

Merged
merged 3 commits into from Sep 9, 2020

Conversation

cgwyllie
Copy link
Contributor

@cgwyllie cgwyllie commented Sep 9, 2020

Description of Changes

Add a client to support contact tracing notifications with Kumulos.

let client = KumulosCheckinClient()

// Check in example
do {
    let checkin = try KumulosCheckin(atLocation: "cuppa-joe-main-st", withContacts: [
        KumulosCheckin.Contact(withLastName: "Bloggs", smsNumber: "+123456789", meta: ["c-19+ve": "no"])
    ])

    client.checkIn(checkin, onComplete: { (outcome) in
        switch (outcome) {
        case let .failure(err):
            print(String(describing:err))
            break
        case let .success(result):
            print(String(describing: result))
            break
        }
    })
} catch {
    print(String(describing:error))
}

// List example
client.getOpenCheckins { (outcome) in
    switch (outcome) {
    case let .failure(err):
        print(String(describing: err))
        break
    case let .success(checkins):
        print(String(describing: checkins))
        break
    }
}

// Check out group example
let checkin = ... // Value from previous list/check in result
client.checkOut(checkins[0]) { (outcome) in
    print(String(describing: outcome))
}

// Check out contact example
let contact = ... // Value from previous list/check in result
client.checkOutContact(checkins[0].contacts[0]) { (outcome) in
    print(String(describing: outcome))
}

Breaking Changes

  • None

Release Checklist

Prepare:

  • Detail any breaking changes. Breaking changes require a new major version number
  • Check pod lib lint passes

Bump versions in:

  • Sources/Kumulos.swift
  • KumulosSdkSwift.podspec
  • KumulosSdkSwiftExtension.podspec
  • Build target version for plist
  • README.md

Release:

  • Squash and merge to master
  • Delete branch once merged
  • Create tag from master matching chosen version
  • Run pod trunk push to publish to CocoaPods

@cgwyllie cgwyllie self-assigned this Sep 9, 2020
@azlindsay azlindsay merged commit 45199ea into master Sep 9, 2020
@azlindsay azlindsay deleted the add-checkins branch September 9, 2020 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants