Skip to content

Camji55/logsnag-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a30d334 Β· Apr 21, 2022

History

9 Commits
Apr 21, 2022
Apr 21, 2022
Apr 21, 2022
Apr 21, 2022
Apr 21, 2022
Apr 21, 2022

Repository files navigation

LogSnag

LogSnag Swift

Get notifications and track your project events.

Discord Documentation

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)