Get notifications and track your project events

LogSnag Swift

Get notifications and track your project events.

Installation

Swift Package Manager

  • File > Swift Packages > Add Package Dependency
  • Add https://github.com/Camji55/logsnag-swift.git
  • Select “Up to Next Major” with “1.0.0”

Usage

Import Library

import LogSnag

Initialize Client

let logsnag = LogSnagClient(
    project: "my-sass",
    token: "7f568d735724351757637b1dbf108e5"
)

Publish Event

async/await

let success = try await logsnag.asyncPublish(
    options: PublishOptions(
        channel: "waitlist",
        event: "User Joined",
        icon: "?",
        notify: true
    )
)

Combine

logsnag.publish(
    options: PublishOptions(
        channel: "waitlist",
        event: "User Joined",
        icon: "?",
        notify: true
    )
)
.sink(
    receiveCompletion: { _ in },
    receiveValue: { _ in }
)
.store(in: &cancellables)

GitHub

View Github