-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b110b0
commit 38847c5
Showing
1 changed file
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
# GatewayAPIKit | ||
|
||
A description of this package. | ||
### GatewayAPIKit is a Swift package used to send text messages (SMS) with [GatewayAPI](https://gatewayapi.com/) for Server Side Swift. | ||
|
||
## Installation | ||
To use GatewayAPI, please add the following to your `Package.swift` file. | ||
|
||
~~~~swift | ||
.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`: | ||
|
||
~~~~swift | ||
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: | ||
~~~~swift | ||
client.send("My text message", to: ["4510203040"], from: "Mads") | ||
~~~~ |