InAppTools is a library written in Swift that let's you easily add mobile users to your mailing lists.
To use InAppTools, you'll first need to generate an APIKEY. To generate one, sign into https://inapptools.com and select Profile. Then, under "API Keys", click "New API Key" and follow the instructions.
- Xcode 14 / Swift 5.7
- iOS >= 15.0
- macOS >= 12.0
To get the id of your mailing list, sign into https://inapptools.com and copy the List ID
of your mailing list.
First, import the library:
import InAppTools
Then, once the user has entered their email address:
let member = try await MailingList(apiKey: apiKey).subscribe(listId: listId, email: email)
If the subscribe
method throws an exception, the most likely causes are an incorrect apiKey, or an incorrect listId.
Calling subscribe
with an email that is already subscribed to your mailing list will not cause an error.
To install InAppTools using Swift Package Manager using Xcode:
- In Xcode, select "File" -> "Add Package Dependencies..."
- Enter https://github.com/dhennessy/inapptools-ios-sdk.git
or you can add the following dependency to your Package.swift
:
.package(url: "https://github.com/dhennessy/inapptools-ios-sdk.git", from: "0.1.0")
Add the following line to your Podfile:
pod 'InAppTools'
See CHANGELOG.md for a list of changes.
InAppTools is available under the MIT license. See LICENSE.md for more info.