Swiftpack.co - Package - madsodgaard/GatewayAPIKit

GatewayAPIKit

GatewayAPIKit is a Swift package used to send text messages (SMS) with GatewayAPI for Server Side Swift.

Installation

To use GatewayAPI, please add the following to your Package.swift file.

.package(url: "https://github.com/madsodgaard/GatewayAPIKit.git", from: "0.1.0")

How to use

All you need to send a text message is to initialize a GatewayAPIClient:

let elg = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
let client = GatewayAPIClient(eventLoopGroup: elg, apiKey: "apikey")

Please store your API key in storage such as environment variables and not directly in code.

You can now send a simple text message:

client.send("My text message", to: ["4510203040"], from: "Mads")

Github

link
Stars: 0
Help us keep the lights on

Used By

Total: 0

Releases

0.1.0 - Nov 23, 2019

Initial release with support for sending text messages