InAppTools 0.4.0

InAppTools 0.4.0

Maintained by Denis Hennessy.



  • By
  • Denis Hennessy

InAppTools

CocoaPods compatible License: MIT

InAppTools is a library written in Swift that let's you easily add mobile users to your mailing lists.

Prerequisites

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.

Requirements

  • Xcode 14 / Swift 5.7
  • iOS >= 15.0
  • macOS >= 12.0

Usage

Adding a user to your mailing list

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.

Installation

Swift Package Manager

To install InAppTools using Swift Package Manager using Xcode:

  1. In Xcode, select "File" -> "Add Package Dependencies..."
  2. 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")

Cocoapods

Add the following line to your Podfile:

pod 'InAppTools'

Release Notes

See CHANGELOG.md for a list of changes.

License

InAppTools is available under the MIT license. See LICENSE.md for more info.